GNOME Bugzilla – Bug 432510
nautilus shows garbaged filenames when copy from samba to local filesystem
Last modified: 2009-11-02 18:06:37 UTC
nautilus shows garbaged filenames when copy from samba to local filesystem because currently there are no logic to treate none UTF-8 filenames on samba. case 1: - users don't create smb.conf(i.e. use the default charsets defined in the samba daemon) or smb.conf has the following charsets: dos charset = CP932 unix charset = UTF-8 display charset = EUC-JP - nautilus is launched on ja_JP.eucJP locale in the client. To reproduce: 1. Type "smb://$host" in the nautilus location bar and move into the directory. It shows correct filenames because GTK uses UTF-8 internally. 2. Copy or DND files into the local filesystems via Nautilus window. Then the filenames are garbaged because the encoding is UTF-8 but nautlius is launched with EUC-JP encoding. case 2: smb.conf has the following charsets: dos charset = CP932 unix charset = EUC-JP display charset = EUC-JP - nautilus is launched on ja_JP.eucJP locale in the client. To reproduce: 1. Type "smb://$host" in the nautilus location bar and move into the directory. Then, it shows garbaged filenames because the encoding is EUC-JP but natilus try to show thoses as UTF-8. I'm attaching the patch.
Created attachment 86821 [details] [review] Patch for libnautilus-private/nautilus-file.c Could you review the patch? Currently ther are no way to recognize the encodings on remote filesystems via gnome-vfs. My suggestion is to have an option that Nautilus considers the encoding on samba filesystem is as same as one on the local filesystem. Then this patch works fine with case #2 above. I.e. users configure "unix charset" in smb.conf to reflect the encoding on client filesystem. This patch fixes displaying filenames, renaming filenames and displaying workgroup names.
Created attachment 87121 [details] [review] Patch for modules/smb-method.c Updated for 2.18
Created attachment 87122 [details] [review] Patch for libnautilus-private/nautilus-file.c Oops, mistook bugid. Reverting the previous patch.
Created attachment 88389 [details] [review] Revised patch I revised the patch after I got comments. Could you review this?
I commented on the list. This doesn't even look at G_BROKEN_FILENAMES_SMB.
Created attachment 88543 [details] [review] Patch for libnautilus-private/nautilus-file-operations-progress.c, libnautilus-private/nautilus-file-operations.c, libnautilus-private/nautilus-file-utilities.c, libnautilus-private/nautilus-file-uti Sorry, I didn't understand your request. I reverted the patch to use G_BROKEN_FILENAMES_SMB. I also noticed when copy many files, the progress dialog also shows broken filenames so I modified nautilus-file-operations.c, too. Could you review the patch?
During the discussion, I think it seems to be better to provide some options. I'm attaching 3 options now.
Created attachment 88990 [details] [review] Option 1: Fixes nautilus-file.c only The option 1 is to fix nautilus-file.c only. Merit - This is a small fix with one file. Demerit - This does not fix the similar problems on other GUIs.
Created attachment 88991 [details] [review] Option2: Provide nautilus_use_local_charset() for the high visible UI The option 2 is to provide nautilus_use_local_charset() for the high visible UI. Merit - The fix is closed in nautilus side - Fixes the high visible UI. Demerit - It's likely that this is also affecting lots and lots of other places.
Created attachment 88992 [details] [review] Option 3: Provide gnome_vfs_locale_uri_to/from_utf8() The option 3 is to provide gnome_vfs_locale_uri_to/from_utf8(). Merit - It may be a preferable way. Demerit - gnome-vfs is deprecated now.
These patches won't apply anymore now that we migrated to GIO in 2.22, settings as "needs-work". Can you verify this is still an issue with latest Nautilus?
Sorry for not responding this. Since I had failed to set up GIO/GVFS, I could not update this. Now we can set up GIO/GVFS so please let me get time to investigate this again.
Takao, any news on this bug? Is this still an issue with Nautilus 2.24/2.26?
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for. Thanks!