Re: auto-upgrading strings to utf8



I tried disabling auto-upgrading in Glib, and my program (a very complex
jukebox) runs fine because all the data I use are utf8, so there is no
need to upgrade strings to utf8 in this case.

The problem here is the data not the upgrade.
Maybe I haven't been clear, my program runs fine with or without
auto-upgrading.

Ideally the glib filename functions should be fixed. Quite a few glib
based programs have had problems with filenames, which become utf8 even
though the locale is say iso-8859-15.

I think we should provide a filename helper of some sort. Either as a
function that take a perl string and returns a filename suited for the
locale or perhaps handling the convertion in the the wrappers for the
functions that access the filesystem.
There is already Glib->filename_from_unicode,
The problem here is that gstreamer put a filename in a glib object
property of type string, and all string properties are auto-upgraded to
utf8.
The function called is $source->set(location => $file);
 which is a generic glib function to set a property.

(now that I think about it a dirty trick to make it work for now would
be to cheat and turn on the utf8 flag on the non-utf8 filename, so it
doesn't get upgraded.)





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]