[MPlayer-dev-eng] locale in GUI

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Mar 12 19:48:05 CET 2013


On Tue, Mar 12, 2013 at 05:56:29PM +0100, Ingo Brückl wrote:
> Reimar Döffinger wrote on Tue, 12 Mar 2013 17:09:43 +0100:
> 
> > However it then simply throws away that information, only keeping the
> > translated name.
> 
> We don't do so in case conversion fails.

Huh? The conversion to UTF-8 should "never" fail.
And it destroys the information what the _real_ file name was.
We thus have to "hope" that the from_utf8 function can figure it out.
And if you read the documentation of e.g. g_get_filename_charsets
it says:
> Determines the preferred character sets used for filenames. The first
> character set from the charsets is the filename encoding, the subsequent
> character sets are used when trying to generate a displayable
> representation of a filename

This means that the from_utf8 function will always use the first
encoding mentioned there.
So if someone sets
G_FILENAME_ENCODING=latin1,utf-8
that should result in the GUI nicely displaying all file names
that are encoded in UTF-8, but not being able to play anything due
to g_filename_from_utf8 it clobbering the UTF-8 string into latin1.
Another way to express it is that the GUI is using g_filename_from_utf8
as if it was the inverse of g_filename_to_utf8, which it is not
(the opposite is however true - but of no help here).


More information about the MPlayer-dev-eng mailing list