<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40601 >

> [cproc - Thu Dec 18 04:42:10 2008]:
> The default Windows character set in western countries is CP1252:
> http://en.wikipedia.org/wiki/CP1252
Ah thanks for that, the last piece of the puzzle. ;)

> In this character set 0xA0 means "non-breakable" space, so this
> character gets stripped by remove_trailing_spaces() when reading
> the nation file.

Indeed, if I start the client with a different local encoding

$ LANG=de_DE ./civ

then the trailling "space" eating behavior occurs. This suggests
that it might be enough to just start the client in a locale
encoded with utf8:
C:\> set LANG=en_US.UTF-8
C:\> civclient.exe

(Of course this should be done in the directory where the
program resides instead of C:.)

But the behavior of remove_trailing_spaces() is troubling.
Would it be safe to just have it remove only ' ', '\t', '\r',
'\v' and '\n', instead of anything for which isspace returns
TRUE? Or would this then cause other problems when other
kinds of "whitespace" characters are used in the user's locale?

Perhaps the server should just set its own (local) encoding to
utf8 when it reads the ruleset files, then set it back to what
it was originally... :?


Freeciv-dev mailing list

Reply via email to