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 102968 - New folder's file encoding problem in GB18030 locales
New folder's file encoding problem in GB18030 locales
Status: RESOLVED DUPLICATE of bug 90154
Product: nautilus
Classification: Core
Component: File and Folder Operations
0.x.x [obsolete]
Other opensolaris
: High normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2003-01-09 18:18 UTC by Hidetoshi Tajima
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
do coverition to UTF-8 when both conditions are met. (722 bytes, patch)
2003-01-09 18:20 UTC, Hidetoshi Tajima
none Details | Review

Description Hidetoshi Tajima 2003-01-09 18:18:57 UTC
On Solaris zh_CN.GB18030 and zh_CN.GBK locales, new 
folder's is created with a garbled name when
G_BROKEN_FILENAMES is set to TRUE.

This is because _("untitled folder") is localized to
UTF-8's string, and when this will be given to
the followings in nautilus_file_get_display_name_nocopy(),
                                broken_filenames = have_broken_filenames ();
                                if (broken_filenames || !g_utf8_validate
(name,\
 -1, NULL)) {
                                        utf8_name = g_locale_to_utf8 (name,
-1,\
 NULL, NULL, NULL);

Here, the "name" is _("untitled folder") so
is already UTF-8's, but due to "broken_filenames ||"
, it is given to g_locale_to_utf8().
Comment 1 Hidetoshi Tajima 2003-01-09 18:20:41 UTC
Created attachment 13450 [details] [review]
do coverition to UTF-8 when both conditions are met.
Comment 2 Hidetoshi Tajima 2003-01-09 18:21:45 UTC
Mark it "HIGH" as the patch's attached.
Comment 3 Hidetoshi Tajima 2003-01-14 22:58:24 UTC

*** This bug has been marked as a duplicate of 90154 ***
Comment 4 Alexander Larsson 2003-01-16 14:54:48 UTC
This patch is wrong.
If G_BROKEN_FILENAMES is true we shouldn't generate a utf8 filename
for the new folder, but instead use the current locale to name it.
Comment 5 Hidetoshi Tajima 2003-01-16 18:15:04 UTC
The patch was first made like yours - but was not sure if non UTF-8
string is allowed to pass gnome_vfs_uri_append_file_name ().
Comment 6 Alexander Larsson 2003-01-17 08:43:34 UTC
gnome_vfs_uri_append_file_name correctly escapes the filename as is
required for the uri, and uris are not inherently in any specific
encoding. They certainly don't have to mbe utf8, that would mean you
couldn't use gnome-vfs to read files if G_BROKEN_FILENAMES were set.