GNOME Bugzilla – Bug 331379
Chinese 'gao' is not shown with coping or symlinking the icon on zh_CN.GBK.
Last modified: 2007-04-23 12:52:06 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.
Created attachment 59455 [details] [review] Patch for libnautilus-private/nautilus-file-operations.c Attached the patch.
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?
Created attachment 60211 [details] [review] Patch for libnautilus-private/nautilus-file-operations.c Revised patch.
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().
Could you review the patch?
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!
I've send nautilus-list my patch and there are no replies. I think this patch is no problem. Could you integrate the patch?
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.
Apparently Takao had an internal patch to glib that caused this. Closing.