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 432510 - nautilus shows garbaged filenames when copy from samba to local filesystem
nautilus shows garbaged filenames when copy from samba to local filesystem
Status: RESOLVED INCOMPLETE
Product: nautilus
Classification: Core
Component: Internationalization (i18n)
unspecified
Other opensolaris
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-04-23 07:46 UTC by Takao Fujiwara
Modified: 2009-11-02 18:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for libnautilus-private/nautilus-file.c (1.95 KB, patch)
2007-04-23 07:57 UTC, Takao Fujiwara
none Details | Review
Patch for modules/smb-method.c (1.64 KB, patch)
2007-04-27 06:49 UTC, Takao Fujiwara
none Details | Review
Patch for libnautilus-private/nautilus-file.c (1.95 KB, patch)
2007-04-27 06:53 UTC, Takao Fujiwara
none Details | Review
Revised patch (2.58 KB, patch)
2007-05-18 13:56 UTC, Takao Fujiwara
needs-work 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 (9.47 KB, patch)
2007-05-21 13:33 UTC, Takao Fujiwara
none Details | Review
Option 1: Fixes nautilus-file.c only (2.54 KB, patch)
2007-05-29 09:01 UTC, Takao Fujiwara
needs-work Details | Review
Option2: Provide nautilus_use_local_charset() for the high visible UI (8.82 KB, patch)
2007-05-29 09:07 UTC, Takao Fujiwara
needs-work Details | Review
Option 3: Provide gnome_vfs_locale_uri_to/from_utf8() (15.91 KB, patch)
2007-05-29 09:12 UTC, Takao Fujiwara
needs-work Details | Review

Description Takao Fujiwara 2007-04-23 07:46:44 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.
Comment 1 Takao Fujiwara 2007-04-23 07:57:50 UTC
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.
Comment 2 Takao Fujiwara 2007-04-27 06:49:40 UTC
Created attachment 87121 [details] [review]
Patch for modules/smb-method.c

Updated for 2.18
Comment 3 Takao Fujiwara 2007-04-27 06:53:51 UTC
Created attachment 87122 [details] [review]
Patch for libnautilus-private/nautilus-file.c

Oops, mistook bugid.
Reverting the previous patch.
Comment 4 Takao Fujiwara 2007-05-18 13:56:47 UTC
Created attachment 88389 [details] [review]
Revised patch

I revised the patch after I got comments.
Could you review this?
Comment 5 Alexander Larsson 2007-05-21 08:31:29 UTC
I commented on the list. This doesn't even look at G_BROKEN_FILENAMES_SMB.
Comment 6 Takao Fujiwara 2007-05-21 13:33:34 UTC
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?
Comment 7 Takao Fujiwara 2007-05-29 08:54:46 UTC
During the discussion, I think it seems to be better to provide some options.
I'm attaching 3 options now.
Comment 8 Takao Fujiwara 2007-05-29 09:01:13 UTC
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.
Comment 9 Takao Fujiwara 2007-05-29 09:07:14 UTC
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.
Comment 10 Takao Fujiwara 2007-05-29 09:12:33 UTC
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.
Comment 11 Cosimo Cecchi 2008-04-01 12:20:28 UTC
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?
Comment 12 Takao Fujiwara 2008-04-01 13:12:45 UTC
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.
Comment 13 Cosimo Cecchi 2009-03-19 18:40:13 UTC
Takao, any news on this bug? Is this still an issue with Nautilus 2.24/2.26?
Comment 14 Cosimo Cecchi 2009-11-02 18:06:37 UTC
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!