Re: filename encoding issues completely broken in glib (and likely also gtk2)?



On Sat, 2008-03-01 at 04:47 +0100, Marc Lehmann wrote:

In short, while const char * is wrong for filenames, so is almost
every use of GPerlFilename when the underlying c function expects a
"glib-filename-encoded" path. There is no suitable typemap entry for
filenames at the moment (which should use SvPVbytes for all functions
taking "glib filename encoding" and SvPVutf for all functions taking utf-8
encoded strings).

The question is how to proceed and clean up that mess.

Since the GPerlFilename typemap and the gperl_filename_from_sv and
gperl_sv_from_filename functions are public API, we can't just remove
them.  And since it's pretty clearly documented what they do, I don't
think we can change their behavior either.

So, what about two new typemaps: one for filenames in GLib encoding, and
one for filenames in UTF-8[1]?  We could then look at every usage of
GPerlFilename and fix it if necessary.

[1] Can't we just use the normal gchar* typemap for filenames that are
supposed to be encoded as UTF-8?

-- 
Bye,
-Torsten




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