Millan wrote:
> On Monday 09 April 2007 13:08:24 Michael Sweet wrote:
>> Millan wrote:
>>> ...
>>> Correct me if I'm wrong, but if one 
>>> calls "setlocale(LC_CTYPE, "en_US.UTF-8")", and since UTF-8 encondig is in 
>>> use, then "normal" portion (I assume you mean on ASCII chars here) is 
> within 
>>> known boundary so it can normally be mapped upper/lower case?
>> Correct, that's why we're OK with our usage.
> 
> Yes, but what I've also meant was that one has to use, for 
> example, "setlocale(LC_CTYPE, "en_US.UTF-8")" and "wcscasecmp()" to perform 
> case-insensitive comparison for non-ascii portion of UTF-8, if someone uses 
> german for example.
> I don't say that current usage is incorrect, but I'm guessing that if one 
> wants to perform already mentioned case-insensitive comparison then he has to 
> iternally, within *his* program, set appropriate locale, translate UTF-8 
> encoded string to wide character string (mbstowcs()), then do the comparation 
> (wcscasecmp()) and then finally if necessary convert that string back to 
> UTF-8 string (wcstombs()), right?

Yeah, or use any of a dozen other libraries for the task, praying
that the locale definitions match your notion of a case-insensitive
comparison and that the code handles comparing composed and
decomposed characters properly (which AFAIK the mbs functions don't...)

-- 
______________________________________________________________________
Michael Sweet, Easy Software Products           mike at easysw dot com
Internet Printing and Document Software          http://www.easysw.com
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to