Converting a character to upper case in string

Vladimir Panteleev thecybershadow.lists at gmail.com
Sat Sep 22 06:01:20 UTC 2018


On Friday, 21 September 2018 at 12:15:52 UTC, NX wrote:
> How can I properly convert a character, say, first one to upper 
> case in a unicode correct manner?

That would depend on how you'd define correctness. If your 
application needs to support "all" languages, then (depending how 
you interpret it) the task may not be meaningful, as some 
languages don't have the notion of "upper-case" or even 
"character" (as an individual glyph). Some languages do have 
those notions, but they serve a specific purpose that doesn't 
align with the one in English (e.g. Lojban).

> In which code level I should be working on? Grapheme? Or maybe 
> code point is sufficient?

Using graphemes is necessary if you need to support e.g. 
combining marks (e.g. ̏◌ + S = ̏S).



More information about the Digitalmars-d-learn mailing list