public inbox for guile-gtk@sourceware.org
 help / color / mirror / Atom feed
From: Hisao Suzuki <suzuki611@okisoft.co.jp>
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	[thread overview]
Message-ID: <E12NAyJ-0000Pb-00@ares.sys1.ngo.okisoft.co.jp> (raw)
In-Reply-To: <87zosurykd.fsf@zagadka.ping.de>

Marius Vollmer <mvo@zagadka.ping.de> 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

  reply	other threads:[~2000-02-22  0:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-20 19:36 Hisao Suzuki
2000-02-21 15:03 ` Marius Vollmer
2000-02-22  0:45   ` Hisao Suzuki [this message]
2000-02-22 11:45     ` Marius Vollmer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E12NAyJ-0000Pb-00@ares.sys1.ngo.okisoft.co.jp \
    --to=suzuki611@okisoft.co.jp \
    --cc=guile-gtk@sourceware.cygnus.com \
    --cc=jarios@usa.net \
    --cc=mvo@zagadka.ping.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).