Subject: | GPerlFilename totally broken |
Date: | Sat, 20 Sep 2008 05:32:48 +0200 |
To: | bug-Glib [...] rt.cpan.org |
From: | Marc Lehmann <schmorp [...] schmorp.de> |
In Glib-1.183, GPerlFilename (gperl_filename_from_sv) is totally broken:
glib and gtk functions that expect a filename expect just that, a raw
filename, not an utf-8 encoded path, not unicode, not an url etc.
The semi-obvious reason for this is that filenames are always
octet-encoded (with the exception of windows, where non-ascii-filenames
are currently completely broken in perl), and in general, there is no way
to represent filenames as unicode.
Unfortunately, Glib completely breaks this clean concept by first forcing
the string to unicode and then using g_filename_from_utf8.
This makes most files not encoded as utf-8 completely inaccessible to
glib/gtk programs, no workaround possible.
The correct way to treat filenames is to treat them exactly like perl
itself and glib itself do, namely as octet strings (e.g. using SvPVbyte).
--
The choice of a Deliantra, the free code+content MORPG
-----==- _GNU_ http://www.deliantra.net
----==-- _ generation
---==---(_)__ __ ____ __ Marc Lehmann
--==---/ / _ \/ // /\ \/ / pcg@goof.com
-=====/_/_//_/\_,_/ /_/\_\