Re: [patch] [bug 432510] samba filename encoding on none UTF-8 locales

I updated the patches. It seems to be better to provide some options.
Which options can be acceptable?

Option 1: Fixes nautilus-file.c only
The option 1 is to fix nautilus-file.c only.
 - This is a small fix with one file.
 - This does not fix the similar problems on other GUIs.

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
 - The fix is closed in nautilus side
 - Fixes the high visible UI.
 - It's likely that this is also affecting lots and lots of other places.

Option 3: Provide gnome_vfs_locale_uri_to/from_utf8()
The option 3 is to provide gnome_vfs_locale_uri_to/from_utf8().
 - It may be a preferable way.
 - gnome-vfs is deprecated now.

Alexander Larsson wrote:
-locale_name = g_filename_from_utf8 (new_name, -1, NULL, NULL, NULL);
+locale_name = g_convert (new_name, -1, filename_charset, "UTF-8", NULL, NULL, NULL);

This changes nothing. This is exactly what g_filename_from_utf8() would

OK, I updated this.

You said that setting G_BROKEN_FILENAMES_SMB is supposed to make
nautilus use the encoding of the locale for smb uris. However, the code
you just posted uses the encoding that is used for filenames when
G_BROKEN_FILENAMES is not set, or if G_FILENAME_ENCODING is set to
something else then it doesn't do what you wanted.

Now, perhaps that is a better thing to do for your usecase, but in that
case the name of the env var is pretty confusing, and you should use
something better.

I see.

+gboolean nautilus_use_local_charset_from_path (const char *text_uri);
+gboolean nautilus_use_local_charset_from_uri (const GnomeVFSURI *uri);
+use_local_charset (NautilusFile *file)

These are very confusing. local and locale are two very different
things. Also, a text_uri is not a "path".
nautilus_use_local_charset_from_uri is also extremely inefficient,
turning the parsed uri into a string just to look at the method name.

I renamed those those functions to follow the scheme of gnome_vfs_remove_directory_from_uri.

Its likely that this is also affecting lots and lots of other places. In
fact, every place in the desktop (including things like the file
selector). I really don't think this can be handled by finding each
place and adding in some smb specific code. A real solution would
include adding the same kind of API as g_filename_to/from_utf8() to
gnome-vfs and using it consistantly everywhere. However, since gnome-vfs
is to be deprecated and the replacement has the proper API for this
(display name and on-disk name is properly separated in the API) it
seems like a bad idea to try to enforce this at this point.

So, I don't really think that this solution is right at this point.

I updated three patches. What do you think there are any ways to fix this problem tentatively until gvfs is available?

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]