<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
e.g.

$ 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
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to