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

Char.isUpper only handles ascii a-z, unlike Char.toUpper #942

Open
drathier opened this Issue Feb 13, 2018 · 4 comments

Comments

Projects
None yet
4 participants
@drathier

drathier commented Feb 13, 2018

Char.toUpper handles non-ascii letters, such as åäö -> ÅÄÖ, but Char.isUpper only handles ascii a-z. I expect them to agree on what characters are upper case.

Same with Char.toLower and Char.isLower.

This is in core 5.1.1 http://package.elm-lang.org/packages/elm-lang/core/5.1.1/Char

@process-bot

This comment has been minimized.

Show comment
Hide comment
@process-bot

process-bot Feb 13, 2018

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

process-bot commented Feb 13, 2018

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

@ufocoder

This comment has been minimized.

Show comment
Hide comment
@ufocoder

ufocoder Feb 28, 2018

@drathier BTW documentation said us that all Classification functions are working only with ASCII. So it's a normal function behavior

ufocoder commented Feb 28, 2018

@drathier BTW documentation said us that all Classification functions are working only with ASCII. So it's a normal function behavior

@drathier

This comment has been minimized.

Show comment
Hide comment
@drathier

drathier Feb 28, 2018

The functions that convert to upper/lower case modify more than just ascii a-z. I'm fine with either, but the combination is troublesome.

Personally, I'd like to drop these 4 functions because not all scripts have upper/lower case characters, so relying on them being different like in English is a problem. This is a request to fix an api inconsitency, not a bug report.

drathier commented Feb 28, 2018

The functions that convert to upper/lower case modify more than just ascii a-z. I'm fine with either, but the combination is troublesome.

Personally, I'd like to drop these 4 functions because not all scripts have upper/lower case characters, so relying on them being different like in English is a problem. This is a request to fix an api inconsitency, not a bug report.

@evancz evancz added the request label Mar 7, 2018

@drathier

This comment has been minimized.

Show comment
Hide comment
@drathier

drathier Mar 21, 2018

Apparently which lowercase characters correspond to what uppercase characters is locale-dependent, so doing the non-ascii version properly will be hard. https://stackoverflow.com/questions/12537377/in-haskell-how-can-i-uppercase-a-unicode-character-with-respect-to-current-local

Also, ß is a single German lowercase character, but it maps to two uppercase characters.

A-z only (which breaks any non-english app with user input, like given names), or dropping support entirely seem to be the two options here.

drathier commented Mar 21, 2018

Apparently which lowercase characters correspond to what uppercase characters is locale-dependent, so doing the non-ascii version properly will be hard. https://stackoverflow.com/questions/12537377/in-haskell-how-can-i-uppercase-a-unicode-character-with-respect-to-current-local

Also, ß is a single German lowercase character, but it maps to two uppercase characters.

A-z only (which breaks any non-english app with user input, like given names), or dropping support entirely seem to be the two options here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment