Skip to content

Documentation (std/String) state that **char** is converted from 4 bytes to UTF8 #143677

Open
@iampi31415

Description

@iampi31415

Location

One conversion instance is here

And here in the .push() docs. I think this could be added just before the example that you are directly linked to.

Summary

Char

There are at least two cases in the docs which would benefit (in my opinion) of a single sentence explaining that char is converted to the UTF-8 representation given that String is UTF-8.

One is here in the introduction where you .push('a') which is a 4 byte character, but is converted into the single byte utf-8 representation. I think it's fine to leave .push instead of .push.str("a") but adding the clarification.

Another here in the .push() docs. I think this could be added just before the example.

At least, that would be appreciated for a beginner like me, maybe not by more knowledgeable users; I raise it just as an option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-strArea: str and Stringneeds-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions