Fix title() and capitalize() by joshuamegnauth54 · Pull Request #7717 · RustPython/RustPython
changed the title
Titlecase fixes
Fix title() and capitalize()
auto-merge was automatically disabled
Head branch was pushed to by a user without write access
auto-merge was automatically disabled
Head branch was pushed to by a user without write access
`icu_casemap` is consistently maintained, official, and tracks the latest Unicode versions. RustPython is also using other `icu4x` crates, so using `icu_casemap` is more consistent. As with islower and isupper, tracking the latest Unicode version is important because character definitions shift over time which causes discrepancies between RustPython and CPython. This commit fixes title().
I dropped unicode-casing because it's cleaner to use icu4x for everything. `icu4x` will also stay up to date whereas unicode-casing will need to be periodically updated with new Unicode tables. Dropping unicode-casing also removes some binary bloat due to the tables. `capitalize()` mimics CPython behavior more closely now as well. Notably, I implemented CPython's sigma edge case handler.
joshuamegnauth54 added a commit to joshuamegnauth54/RustPython that referenced this pull request
The tests for swapcase() were failing for two reasons. The first is '𐐧' casing which should be fixed with modern Unicode tables. The second failure is due to CPython's sigma override, which I implemented in PR RustPython#7717.
joshuamegnauth54 added a commit to joshuamegnauth54/RustPython that referenced this pull request
The tests for swapcase() were failing for two reasons. The first is '𐐧' casing which should be fixed with modern Unicode tables. The second failure is due to CPython's sigma override, which I implemented in PR RustPython#7717.
youknowone pushed a commit that referenced this pull request
The tests for swapcase() were failing for two reasons. The first is '𐐧' casing which should be fixed with modern Unicode tables. The second failure is due to CPython's sigma override, which I implemented in PR #7717.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters