After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 140532 - g_filename_to_uri() should not encode flenames in UTF-8
g_filename_to_uri() should not encode flenames in UTF-8
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.4.x
Other All
: High major
: ---
Assigned To: Federico Mena Quintero
Federico Mena Quintero
: 107695 120089 140980 (view as bug list)
Depends on:
Blocks: 138158
 
 
Reported: 2004-04-19 18:38 UTC by Federico Mena Quintero
Modified: 2011-02-18 16:07 UTC
See Also:
GNOME target: ---
GNOME version: 2.5/2.6


Attachments
Patch with proposed fix. (4.16 KB, patch)
2004-04-19 18:41 UTC, Federico Mena Quintero
none Details | Review

Description Federico Mena Quintero 2004-04-19 18:38:56 UTC
1. export LANG=es_MX.ISO8859-1
2. export G_FILENAME_ENCODING=@locale
3. open gedit
4. Save a file called "αινσϊ"
5. Try to open the file

Gedit says that the file does not exist and whether you would like to create it.

The problem is that g_filename_to_uri() considers filenames to be in UTF-8.  It
shouldn't do this, as filenames don't have a specified encoding.  See the
detailed report here:

http://mail.gnome.org/archives/gtk-devel-list/2004-April/msg00148.html

The attached patch fixes this in g_filename_to_uri() and g_filename_from_uri().
Comment 1 Federico Mena Quintero 2004-04-19 18:41:20 UTC
Created attachment 26827 [details] [review]
Patch with proposed fix.
Comment 2 Owen Taylor 2004-04-20 14:07:23 UTC
Fixing the summary since the current code doesn't assume filenames
are UTF-8, rather it encodes them in UTF-8 before creating the URL.
Comment 3 Matthias Clasen 2004-04-23 13:52:47 UTC
What needs to happen here is that somebody must check that this doesn't
negatively affect large parts of Gnome. If it doesn't, we should get it in
2.4.2. If it does, we should get it in 2.6 and make sure people are aware of
what needs fixing when they move to gtk+ 2.6.
Comment 4 Federico Mena Quintero 2004-04-29 23:27:54 UTC
I did a recursive grep on the sources, and only the GIMP seems to use it in a
few places.  I think we should fix it as soon as possible.
Comment 5 Federico Mena Quintero 2004-05-04 20:11:17 UTC
*** Bug 107695 has been marked as a duplicate of this bug. ***
Comment 6 Federico Mena Quintero 2004-05-04 20:14:18 UTC
*** Bug 120089 has been marked as a duplicate of this bug. ***
Comment 7 Federico Mena Quintero 2004-06-08 03:32:01 UTC
Fixed in both HEAD and the glib-2-4 branches.
Comment 8 Federico Mena Quintero 2004-07-08 23:12:42 UTC
*** Bug 140980 has been marked as a duplicate of this bug. ***