[MPlayer-dev-eng] [PATCH] localize with gettext (libintl)

Ötvös Attila oattila at chello.hu
Thu Nov 30 00:52:35 CET 2006


2006. november 29. 23.50 dátummal Reimar Döffinger ezt írta:
> You cannot - I emphasize - you _can not_ use setlocale, it breaks the
> behaviour of all kinds of C library functions, most notably strcasecmp,
> in a way that e.g. causes crashes if the locale is tr_TR. In addition it is
> not thread-safe, so that setting it every time you need it and restoring
> it again is at least risk and quite likely to cause problems, too (yes,
> indirectly through libavcodec even MPlayer uses threads!).

My question: 

This is good idea:

mp_msg_init()
...
setlocale(LC_MESSAGES,"");	// set lc_messages
setlocale(LC_TYPE,"");		// locale character ...
bindtextdomain("mplayer","/usr/share/locale");
bind_textdomain_codeset("mplayer",nl_langinfo(CODESET));
textdomain("mplayer");
setlocale(LC_TYPE,"C");		// locale default

I quicly probe with LC_ALL=tr_TR so work 
(without setlocale(LC_TYPE,"C") don't work).

Attila



More information about the MPlayer-dev-eng mailing list