You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The case-folding performed is the common or simple mapping: it maps one Unicode codepoint to its uppercase equivalent according to the Unicode database. The additional [SpecialCasing.txt] is not yet considered here, but the iterator returned will soon support this form of case folding.
The case-folding performed is the common or simple mapping. See to_uppercase() for references and more information.
Right now, char::to_uppercase and char::to_lowercase disregard graphemes whose lowercase codepoints do not map one-to-one with their uppercase codepoints. For example, U+FB02 fl LATIN SMALL LIGATURE FL, a single codepoint, maps to two characters: 'F' and 'L'. Yet, when we try converting it to uppercase in Rust...
...rather than the expected "FLAVOR", we get "flAVOR", an incorrect result.
As the description of char::to_uppercase explains, this behavior is expected to change. However, currently char::to_uppercase, char::to_lowercase, and their associated iterators std::char::ToUppercase and std::char::ToLowercase are all marked stable, yet fixing this behavior would be a breaking change.
The text was updated successfully, but these errors were encountered:
Thanks for the report! This sort of change is definitely planned, however, and has yet to be implemented. The switch from returning just a plain char to returning an iterator of characters reflects this. A minor update such as this will not be considered a breaking change, especially because of the way the documentation is currently worded. As a result I'm going to close this issue for now in favor of #25800, which reflects the current plan.
The description of
char::to_uppercase
reads:Similarly,
char::to_lowercase
reads:Right now,
char::to_uppercase
andchar::to_lowercase
disregard graphemes whose lowercase codepoints do not map one-to-one with their uppercase codepoints. For example,U+FB02 fl LATIN SMALL LIGATURE FL
, a single codepoint, maps to two characters: 'F' and 'L'. Yet, when we try converting it to uppercase in Rust......rather than the expected "FLAVOR", we get "flAVOR", an incorrect result.
As the description of
char::to_uppercase
explains, this behavior is expected to change. However, currentlychar::to_uppercase
,char::to_lowercase
, and their associated iteratorsstd::char::ToUppercase
andstd::char::ToLowercase
are all marked stable, yet fixing this behavior would be a breaking change.The text was updated successfully, but these errors were encountered: