Follow-up Comment #5, bug #15377 (project freeciv):

Yep, that is surely correct.

"These  functions  check  whether  c,  which  must  have the value of an
unsigned char or EOF, falls into a certain character class according to the
current locale."

Each of the "character function wrappers" in support.[ch] works only on
characters in the current locale, which in freeciv parlance is the local
encoding, and generally not the same as UTF-8 at all. In other words, these
functions cannot be used on nearly all freeciv strings without causing these

Replacing these is not an easy task.  Their very nature is to operate
byte-by-byte, but with freeciv using utf-8 internally this is not possible. 
One alternative used elsewhere is to convert the utf-8 string to a
fixed-width encoding such as UCS2 (similar to utf-16) or UCS4 (similar to
utf-32) which can then be operated on byte-by-byte, but since that is also
not the "current locale" the functions will not work on those characters
either.  Having all of Freeciv use ucs4 internally could even be an option,
discussed previously that would prevent all such problems as there could then
be no confusing "internal" strings from "current locale" strings; however,
this would require a LOT of work and has been dismissed in the past.

Additionally there may be a few locations where the text is ascii and the
character functions will and should be used.  Maybe.

I'll take a look at where these functions are used and what might be done
about them.



Reply to this item at:


  Message sent via/by Gna!

Freeciv-dev mailing list

Reply via email to