Skip to content

Conversation

DmitryOlshansky
Copy link
Member

This changes few badly generated tables that are used in toUpper/toLower breaking toUpper in some cases.

Apparently 9629 was fixed with new std.uni, this pull adds a test case for it.

Also fixes a typo in generic toCase, adds test cases for
previously fixed issue 9629
@quickfur
Copy link
Member

Why is toLower("\u1E9E")=="\u00df") but toUpper("\u00df")=="SS"? Is this according to the Unicode spec?

Other than that, LGTM.

@monarchdodra
Copy link
Collaborator

Is this according to the Unicode spec?

Yeah, it's one of those special cases. Unicode makes no promise that the upper case of a character is the uppercase of the lower case. This is because of a "N uppercase version to 1 lower case version".

Also, any letter that is "capital case" may expose similar "odd" behavior. Though to be honest, ẞ really is exceptional in this regard.

@DmitryOlshansky
Copy link
Member Author

Why is toLower("\u1E9E")=="\u00df") but toUpper("\u00df")=="SS"? Is this according to the Unicode spec?

By spec. In general composition of toUpper.toLower may permute a string that was all lowercase, ditto with toLower.toUpper.

@quickfur
Copy link
Member

Ah, another one of those Unicode complexities. Fair enough. LGTM. :)

@monarchdodra monarchdodra merged commit 256b62b into dlang:master Sep 26, 2013
@monarchdodra
Copy link
Collaborator

Closing as this is superseded by the pulled #1594 .

@DmitryOlshansky DmitryOlshansky deleted the fix-uni-upper branch October 15, 2013 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants