Re: [BUG] Glib::filename_from_unicode seems not to work.



Jan Hudec said:
Hello,

I have problems with filename_from_unicode there. While
filename_to_unicode does exactly the right thing (converts local
filename (from command-line) to unicode), the filename_from_unicode
function does NOT do the revere. That is
$file ne filename_from_unicode(filename_to_unicode($file))

i think i see what the bug is.  the xsubs for these are rather deceptive,
letting the GPerlFilename typemap do all the actual work, and using logic on
the number of parameters to support function or static method calling
conventions.

a t-dir test should've picked this up, but we don't appear to have one[1].

would you mind writing up a test that we could include?

also, try this patch (one-line fix, don't let the lines wrap):

diff -u -r1.31 Glib.xs
--- Glib.xs     27 Feb 2004 02:39:08 -0000      1.31
+++ Glib.xs     1 Apr 2004 19:10:24 -0000
@@ -327,7 +327,7 @@
 =for apidoc __hide__
 =cut
 const char *
-filename_from_unicode (const char * class_or_filename, const char
*filename=NULL)
+filename_from_unicode (GPerlFilename_const class_or_filename,
GPerlFilename_const filename=NULL)
     PROTOTYPE: $
     CODE:
        RETVAL = items < 2 ? class_or_filename : filename;


[1] the standard reason is that "muppet is a merkin country bumpkin who
doesn't know how all this i18n stuff works."

-- 
muppet <scott at asofyet dot org>



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