[MPlayer-dev-eng] [PATCH] use system locale instead of C locale

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon May 18 16:04:57 CEST 2009


On Mon, May 18, 2009 at 03:05:46PM +0200, Diego Biurrun wrote:
> On Mon, May 18, 2009 at 09:57:43PM +0900, KO Myung-Hun wrote:
> > 
> > Reimar Döffinger wrote:
> > >On Sun, May 17, 2009 at 03:41:43PM +0900, KO Myung-Hun wrote:
> > >  
> > >>This patch makes MPlayer use system locale instead of C locale on OS/2.
> > >
> > >And will break half of MPlayer if the system locale is e.g. turkish
> > >(basically anything using strcasecmp breaks completely).
> > 
> > Why ?
> 
> Short answer: locale sucks.
> Long answer: Use Google and find out what happens if you uppercase
> Turkish strings with i and ı (i without dot).  It's a royal mess.

I think I should point that this is not the only issue, e.g. the manual
would be wrong for all locales that use "," instead of "." as a decimal
separator, since all the string -> float conversion functions take
locale into account, too. I think for scanf there is a GNU extension
to disable this behaviour, but without relying on that most filters
would not be usable or at least a huge pain (since "," is used to separate
between filters, so it's hard to have it mean a decimal separator, too).
Seriously, we used the system locale before, but it caused a huge mess,
you should be able to find the discussion in the archive.
Also, the solution to e.g. only set locale in mp_msg does not work
(right) either, firstly because some frontends can't handle when e.g.
"25.000 fps" suddenly becomes "25,000 fps" but also because locale
(usually) is global, thus such an approach would not be thread-safe and at
least the cache implementation on e.g. Windows (and I think OS/2) uses
threads and thus you might have mysterious breakages there.



More information about the MPlayer-dev-eng mailing list