[MPlayer-dev-eng] locale in GUI

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Mar 12 20:38:45 CET 2013


On Tue, Mar 12, 2013 at 08:01:34PM +0100, Reimar Döffinger wrote:
> On Mon, Mar 11, 2013 at 11:13:44AM +0100, Reimar Döffinger wrote:
> > "Ingo Brückl" <ib at wupperonline.de> wrote:
> > >In short: If you have UTF-8 encoding, don't set the GLib environment
> > >variables - everything will work just fine. Without UTF-8 encoding,
> > >explicitly tell GLib by G_FILENAME_ENCODING which encoding you are
> > >using.
> > >Don't use @locale or G_BROKEN_FILENAMES.
> > 
> > The point of my suggestion is to make it work without such arbitrary rules.
> > The from_utf8 function cannot work on a system that mixes utf8 and Latin1 file names, while the to_utf8 can work just fine. Thus avoiding the former (which for us should not be a big problem) makes the code more robust.
> 
> So, I was vague because I didn't have time to look at the
> documentation.
> My suggestion is to use e.g. gtk_clist_set_row_data to
> store the original string we passed into the to_utf8
> function.
> Then instead of using the from_utf8 functions with its
> issue we can use gtk_clist_get_row_data, which should
> make the code work even for the strangest cases.
> I am sure I missed some details, but so far this looks
> like very little additional code for making it a whole
> lot more reliable.

Attached is a proof-of-concept.
Should be applied to other files as well and might need
some cleanup/fixes, but the idea seems to work I think.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: avoid_from_utf8.diff
Type: text/x-diff
Size: 3404 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20130312/8877f399/attachment-0001.bin>


More information about the MPlayer-dev-eng mailing list