[MPlayer-dev-eng] [PATCH] GTK2 support
dalias at aerifal.cx
Tue Feb 21 19:47:31 CET 2006
On Tue, Feb 21, 2006 at 11:55:18AM +0100, Reimar Döffinger wrote:
> On Mon, Feb 20, 2006 at 06:39:24PM -0500, Rich Felker wrote:
> > I oppose using gettext. It's bloated and catgets (the standard POSIX
> > message catalog system as opposed to the GNU replacement) fits much
> > better with MPlayer's existing model of using #defines for the
> > messages. Look up catgets and see how it works.
> Hmm. The (my) man page for it is rather useless. First, only "XPG4.2" is
> mentioned as standard specifying it - something I never heard of, which
> makes me wonder on how many systems it is available on.
XPG4.2 is an old name for the X/Open Portability Guide, version 4.2.
This is the standard that developed (along with POSIX) into the Single
Moreover, GNU libc and GNU gettext include catgets support too, so it
will be available on any GNU system. Aside from that, if a system
doesn't have catgets it will probably not have gettext either since
the only implementation of gettext (AFAIK) is the GNU one.
> Secondly, it does not say how charsets are handled. Does it need
> LC_CTYPE set?
No. Unlike gettext it has nothing to do with character encoding. It
only uses the LC_MESSAGES category, and only needs it specified at the
time you call catopen (i.e. you can reset the LC_MESSAGES category
after opening the message catalog).
> And if yes, when, when opening the catalog or every time?
> If now, how does it know which charset to use?
It doesn't. It's purely a string lookup. The intent of the designers
was that each locale/lang has exactly one character encoding, which is
obviously stupid. However it works just as well to use it with UTF-8
and do the conversion via iconv in mp_msg.
What's nice about catgets is that it does nothing behind your back,
and nothing bloated. The system is very simple (so simple we could
even include our own fallback version in osdep if we wanted...).
More information about the MPlayer-dev-eng