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 331379 - Chinese 'gao' is not shown with coping or symlinking the icon on zh_CN.GBK.
Chinese 'gao' is not shown with coping or symlinking the icon on zh_CN.GBK.
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Internationalization (i18n)
2.17.x
Other All
: Normal normal
: 2.18.x
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-02-16 07:20 UTC by Takao Fujiwara
Modified: 2007-04-23 12:52 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
Patch for libnautilus-private/nautilus-file-operations.c (869 bytes, patch)
2006-02-16 07:21 UTC, Takao Fujiwara
reviewed Details | Review
Patch for libnautilus-private/nautilus-file-operations.c (1.69 KB, patch)
2006-02-27 08:00 UTC, Takao Fujiwara
none Details | Review

Description Takao Fujiwara 2006-02-16 07:20:14 UTC
Please describe the problem:
In get_next_duplicate_name(), none UTF-8 strings are send to the argument of
gnome_vfs_escape_path_string() so the strings are broken.

Steps to reproduce:
1. Invoke nautilus window and move into a directory.
2. create one new file, and name file 'gao'(as refered U+85C1 for UTF-8) on
zh_CN.GBK.
3. right click the new file and choose 'make link' from popup menu.


Actual results:
New linked file name show '??'

Expected results:


Does this happen every time?


Other information:
I'm attaching the patch.
Comment 1 Takao Fujiwara 2006-02-16 07:21:46 UTC
Created attachment 59455 [details] [review]
Patch for libnautilus-private/nautilus-file-operations.c

Attached the patch.
Comment 2 Martin Wehner 2006-02-16 23:58:30 UTC
Comment on attachment 59455 [details] [review]
Patch for libnautilus-private/nautilus-file-operations.c

That doesn't make much sense really. Why do you modify get_next_duplicate_name when you want to fix link name creation? Also I think gnome_vfs_escape_path_string can handle non UTF-8 fine.
I could reproduce the bug however and commited something on HEAD what I believe is the right fix. Could you check if that fixes your problem too?
Comment 3 Takao Fujiwara 2006-02-27 08:00:10 UTC
Created attachment 60211 [details] [review]
Patch for libnautilus-private/nautilus-file-operations.c

Revised patch.
Comment 4 Takao Fujiwara 2006-02-27 08:06:56 UTC
Sorry, I could not remember why I created the previous patch... Please check the updated patch.

This problem caused by g_utf8_validate().
g_filename_to_utf8() calles g_utf8_validate() internally and then GB2312 char 0xde 0xbb is recognized as UTF-8 and return TRUE.

Then the native character is recognized as UTF-8.

The updated patch means if G_BROKEN_FILENAMES is defined, we use g_locale_to_utf8() instead of g_filename_to_utf8().
Comment 5 Takao Fujiwara 2006-10-25 07:48:36 UTC
Could you review the patch?
Comment 6 Christian Neumair 2006-12-26 19:20:46 UTC
Updating bug info since this is still an issue.


Thanks for your efforts, I really like the patch!

Maybe you could submit it to nautilus-list for official review?
http://mail.gnome.org/mailman/listinfo/nautilus-list

Sorry for all the hazzle and delay!
Comment 7 Takao Fujiwara 2007-02-21 15:00:35 UTC
I've send nautilus-list my patch and there are no replies.
I think this patch is no problem. Could you integrate the patch?
Comment 8 Alexander Larsson 2007-04-23 11:20:55 UTC
As I posted on the list, I think this patch is strange. 
g_filename_to_utf8() should already look at the G_BROKEN_FILENAMES env var and use the locale encoding if that is set. Can someone please explain why this patch is good.
Comment 9 Alexander Larsson 2007-04-23 12:52:06 UTC
Apparently Takao had an internal patch to glib that caused this. Closing.