Issue 10204 - std.string does not take title case into account
Summary: std.string does not take title case into account
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-29 09:53 UTC by monarchdodra
Modified: 2024-12-01 16:17 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description monarchdodra 2013-05-29 09:53:36 UTC
Unicode 6.2.0 introduces the notion of "Title case", making the trio of:

"Lower case" => "Title case" => "Upper case"

Example:
01c6  01c5  01c4
dž     Dž     DŽ

This means that functions such as "capitalize" are wrong because they make the assumption that "Capitalize" == "Uppercase"

Also, the tests such as:

if(std.uni.isLower(c))
    c = std.uni.toUpper(c);

are wrong, as non lower case characters may have upper case representations...
Comment 1 monarchdodra 2013-05-29 12:19:47 UTC
Partially fixed here:
https://github.com/D-Programming-Language/phobos/pull/1322

Fixes only to[Upper|Lower](InPlace).

however, "capitalize" is still broken.
Comment 2 berni44 2019-12-20 14:20:34 UTC
I don't completely understand the problem. Could you provide an example which produces a wrong output together with a note, what it should produce?
Comment 3 dlangBugzillaToGithub 2024-12-01 16:17:46 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/phobos/issues/9979

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB