Follow-up Comment #2, patch #1582 (project freeciv):

Nice, this is of course going to be really useful.

I'm going to spew some opinions and thoughts, please don't assign too much
importance to them:
 
* UTF-8 doesn't use longer characters than 4-byte sequences. Freeciv
shouldn't output anything outside of that (accepting it is ok I guess, but
where would it come from?)
* Many of the functions are just there to make sure we do truncation in a
"nice" way. IMO, truncation is the bad thing we are doing, it's not how we
are doing it. We don't need this, if we stop truncating. However, a function
to do truncation specifically when needed might be useful.
* UTF-8 is ascii compatible and our functions are always 8-bit clean. We
could get away with less special functions of course
* We don't always want truncation when a string is not valid. Consider a
string beginning with an Ö character in latin-1 encoding. With this code, it
would be truncated to a zero-length string. Often where illegal encodings are
used, replacement chars are inserted instead. Would it be better to render it
"?text continues" than just ""? (We could use U+FFFD "REPLACEMENT CHARACTER").
 The latter use is much better when we deal with illegal encodings/wrongly
encoded text. The former much better when "fixing up" truncation (so same
thing again).

two typos: uft8_char, fc_ut8_next_char

    _______________________________________________________

Reply to this item at:

  <http://gna.org/patch/?1582>

_______________________________________________
  Meddelandet skickades via/av Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to