-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve the AsciiStr trait #17790
Comments
cc #16801 |
cc me |
AsciiStr::to_lower is now AsciiStr::to_lowercase and AsciiStr::to_upper is AsciiStr::to_uppercase to match Ascii trait. Part of issue #17790. This is my first pull request so let me know if anything is incorrect. Thanks! [breaking-changes]
#17947 fixes the AsciiStr::{to_lower,to_upper}().
This should probably be a new RFC. If so this issue can be closed. |
Close this issue hoping |
I assume that The problem is that the concepts of “upper case”, “letter”, and “words” are not easy to define for international text. For example, the upper case of i in Turkish is İ, instead of I in other languages. Some languages don’t use spaces to separate words, or don’t have case. And a single string might contain text in multiple languages. Variations of The Unicode Standard and the Unicode Common Locale Data Repository can help do this right, but there are still many possible variations. It’s not obvious which and how many of these should be included in Rust’s standard library. Because this is a complex topic, I did not include it in rust-lang/rfcs#486. I suggest starting a separate discussion or RFC. |
@SimonSapin Right, I should have thought in the framework of Unicode from the beginning 😛 |
AsciiStr::to_lower()
andAsciiStr::to_upper()
should be renamed toAsciiStr::to_lowercase()
andAsciiStr::to_uppercase()
, respectively, whenAscii::to_lower()
andAscii::to_upper()
are deprecated in favor ofAscii::to_lowercase()
andAscii::to_uppercase()
.Incidentally, we should perhaps import
capitalize()
andcapwords()
from Python.The text was updated successfully, but these errors were encountered: