Follow-up Comment #16, bug #15377 (project freeciv):
Having 2 sets of functions is trickier than it sounds. For one, you have to
be extremely careful which you use where. For a second, neither one should
really be using the libc character functions. And for a third, the functions
we're talking about _cant_ be written for variable-width character sets like
utf-8 so they all have to be replaced with string variants. I took a look at
doing this but it's just way too many places and too wide a spectrum of the
codebase affected to do so without upping the bug rate.
Glib or libutf8 can provide some help on some of these functions, I do
believe. We dont have glib as a requirement for server compilation however,
though it wouldnt be a big deal to add it.
To change the internal encoding to ucs4 I would introduce a new typedef,
"typedef uint32 fc_char" into fciconv.h. The majority of internal strings
then get changed from char[] to fc_char[]. String conversion is mostly done
already via the fciconv or gettext functions, but what would have to be added
is conversion of all data files read (from utf8/ascii into ucs4) and to all
gui strings (again between ucs4 and utf8, both ways and in a lot of places).
Perhaps the biggest challenge though would be server-generated strings, which
can't use sprintf but instead will need a ucs4 version of the same (probably
available through an external library).
-jason
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?15377>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev