[MPlayer-dev-eng] locale in GUI

Dan Oscarsson Dan.Oscarsson at tieto.com
Mon Mar 11 08:23:01 CET 2013


sön 2013-03-10 klockan 20:32 +0100 skrev Reimar Döffinger:

> >>> This is because setting the locale is disabled by gtk_disable_setlocale()
> >>> in gui/dialog/dialog.c (r22126) and thus glib works on the "C" locale. Does
> >>> anybody remember the reason?
> >> See
> >> http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2010-December/067107.html
> > I suspected such adversity...
> > 
> > What about that:
> > 
> > old_locale = setlocale(LC_ALL, NULL);
> > setlocale(LC_ALL, "");
> > g_filename_to_utf8(...);
> > setlocale(LC_ALL, old_locale);
> > 
> > Bad hack, admittedly.
> 
> No, broken. setlocale affects all threads. It might result in for
> example HTTP requests made by the cache (if run in thread instead of
> separate process) randomly generating wrong requests.
> A debugging nightmare.

I assume this problem is due to bad programming. Parsers should not be
dependent on locale if they expect, for example, real numbers to have a
decimal point. In a GUI local preferences should be used - this includes
displaying numbers using the decimal separator of current locale and
dates as specified by current locale.

   Dan



More information about the MPlayer-dev-eng mailing list