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



On Wed, Mar 19, 2008 at 10:11:31AM +0100, Torsten Schoenfeld <kaffeetisch gmx de> wrote:
I just realized that you probably hadn't seen my reply...

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.

Hoever, these fucntions are not (IMHO) buggy, they are just very badly
named, they should be called something like gperl_filename_from_unicode and
vice versa (incidentally, this is the name I used for the perl-level API).

On the other hand, filename_to_unicode is completely broken right now
(in revision 1.51):

   filename_to_unicode (const char * class_or_filename, const char *filename=NULL)

"char *" as input is wrong in 100% of the cases, as perl (unfortunately)
just delivers either the string encoded as utf-8 or latin1, without any
way to tell (if one wants to use char *, then one has to test utf-8-ness
separately).

This means that this function gives basically random results (for the
same perl string value, it can return two different values depending on
internal optimisations and history inside perl).

For filename_to_unicode, gchar * would likely be correct.

filename_from_unicode looks correct to me, as the internal function uses
SvPVutf8 (on a related note, SvPV is also wrong in all cases where SvUTF8
isn't being checked seperately).

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      pcg goof com
      -=====/_/_//_/\_,_/ /_/\_\



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