Skip to content
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

use titlecase, not uppercase, for ucfirst #21967

Merged
merged 1 commit into from
May 21, 2017

Conversation

stevengj
Copy link
Member

Separate from questions of what ucfirst should be called or whether it should even exist (#21910), the current behavior was clearly wrong (using uppercase rather than titlecase) for Unicode. This PR fixes that.

Most users won't notice any difference, since titlecase and uppercase are almost always the same. (Of the 2621 Unicode characters that have case at all, only 12 have a distinct titlecase.)

The Julia ucfirst function seems to have been modeled on the Perl ucfirst function, which uses titlecase. However, when the Julia ucfirst function was written, we didn't have access to the Unicode tables needed to implement titlecase.

@stevengj stevengj added strings "Strings!" unicode Related to unicode characters and encodings labels May 19, 2017
Copy link
Member

@ararslan ararslan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ararslan ararslan merged commit 03a6768 into JuliaLang:master May 21, 2017
@stevengj stevengj deleted the ucfirst_tc branch May 22, 2017 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
strings "Strings!" unicode Related to unicode characters and encodings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants