[erlang-questions] How to capitalize the first letter of Unicode string?

Richard A. O'Keefe ok@REDACTED
Tue May 14 05:33:28 CEST 2013


On 14/05/2013, at 10:16 AM, Martin Dimitrov wrote:
> Can you suggest a way to capitalize the first letter of a Unicode string?
Pierre Fenoll <pierrefenoll@REDACTED> replied:
>Isn't there a unicode modifier code point that capitalizes the code point next to it?

No, there isn't.

There are four titlecase letters and 1294 lower case letters in the
UnicodeData.txt I just checked -- not sure what version that is, and
I didn't count the TAG LATIN SMALL LETTER ... entries, which should
not be converted.

Unicode case conversion, done properly, is locale dependent, and
may change the length of a string.

The operation wanted here is, in all likelihood, conversion to
title case rather than upper case.

I have a crude hack which has worked adequately for me, but I really
can't bring myself to put something that awful in this mailing list.




More information about the erlang-questions mailing list