From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hisao Suzuki To: mvo@zagadka.ping.de Cc: jarios@usa.net, guile-gtk@sourceware.cygnus.com Subject: Re: guile-gtk-0.17 i18n Date: Tue, 22 Feb 2000 00:45:00 -0000 Message-id: References: <87zosurykd.fsf@zagadka.ping.de> X-SW-Source: 2000-q1/msg00041.html Marius Vollmer wrote: > Why do you have to call gtk_set_locale before gtk_init? Is there a > good reason for this or can it be considered a bug in Gtk+? gtk_init parses locale-specific gtkrc file(s) and opens a locale-specific input method via XOpenIM(3x) of Xlib. The locale is supposed to have been already set. gtk_set_locale invokes setlocale(3), and here is its man page: | SETLOCALE(3) Linux Programmer's Manual SETLOCALE(3) | | NAME | setlocale - set the current locale. [snip] | On startup of the main program, the portable "C" locale is | selected as default. [snip] Thus you have to call gtk_set_locale before gtk_init. > What are the consequences of calling gtk_set_locale? Are there good > reasons why anyone does _not_ want to call gtk_set_locale? Why > doesn't gtk_init call gtk_set_locale itself? Besides setting the locale, gtk_set_locale sets gdk_use_mb, a static gboolean variable which indicates whether multibyte characters may be used or not, according to the locale. In any case, if you are in "C" locale, everything is the same as default. I don't know why gtk_init doesn't call gtk_set_locale. Maybe it is just a historical reason, or maybe some applications want to run in "C" locale against any LANG environment variable value. -- Hisao Suzuki suzuki611@okisoft.co.jp, suzuki@acm.org