[MPlayer-dev-eng] locale in GUI

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Mar 10 20:32:06 CET 2013



On 10 Mar 2013, at 20:24, Hans-Dieter Kosch <hdkosch at kabelbw.de> wrote:

> Hi Ingo,
> 
> thanks for the quick response.
> 
> Ingo Brückl wrote:
>> Hans-Dieter Kosch wrote on Sun, 10 Mar 2013 19:24:37 +0100:
>>> the function g_filename_to_utf8() used in the GUI (fileselect.c,
>>> playlist.c) doesn't return a filename containing characters outside the
>>> standard ASCII range.
>> Please elaborate. I didn't notice any problems so far.
> Just try a filename with german Umlauts, g_filename_to_utf8() returns NULL with conversion error.
> 
>>> 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.


More information about the MPlayer-dev-eng mailing list