[Gtkradiant] ZeroRadiant and locale
Rudolf Polzer
divVerent at alientrap.org
Sun Nov 14 23:51:14 CST 2010
On Sat, Nov 13, 2010 at 05:42:01PM -0800, Nerius Landys wrote:
> I did some research and putenv() seems to be the best choice for being
> cross-platform. It
> used to be a function in Windows (now deprecated):
> http://msdn.microsoft.com/en-us/library/ms235321(VS.80).aspx
> And of course it's defined in UNIX.
>
> One more thing. the gtk_init() call below modifies all of the locale
> settings. In fact if it
> weren't for gtk_init(), we wouldn't have to set LC_NUMERIC (parsing of
> floating points with
> a dot works just fine before the gtk_init() call on a sample Linux system).
> If we were to
> just setlocale() here, it would get clobbered by gtk_init(). So instead of
> using setlocale()
> _after_ gtk_init(), I chose to fix this problem via environment variable.
> I think it's cleaner
> that way.
> */
> putenv("LC_NUMERIC=C");
In GtkRadiant 1.5 I find this:
gtk_disable_setlocale();
gtk_init(&argc, &argv);
which SEEMS to be an alternate fix for this. However, maybe something else
still calls setlocale? Also, I disagree a bit with this fix - I do think that
LC_CTYPE should have influence so the user can set an utf-8 locale.
Basically, the first thing I would need is a test case of this.
More information about the Gtkradiant
mailing list