diff options
author | Dave Camp <dave@novell.com> | 2004-06-09 19:51:27 +0000 |
---|---|---|
committer | Dave Camp <campd@src.gnome.org> | 2004-06-09 19:51:27 +0000 |
commit | f8e189c7fa8c66c90c73142b880f1a113fabfc87 (patch) | |
tree | cca11b473834647867133c3eccde7b9c48f29c2d | |
parent | 3c85ba8ee01775acd5bbd57a00ae11ccac1028cc (diff) | |
download | nautilus-f8e189c7fa8c66c90c73142b880f1a113fabfc87.tar.gz |
Try to convert from the locale if G_BROKEN_FILENAMES isn't set and the
2004-06-09 Dave Camp <dave@novell.com>
* libnautilus-private/nautilus-file-operations.c:
(get_next_duplicate_name): Try to convert from the locale
if G_BROKEN_FILENAMES isn't set and the filename isn't valid
utf8.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | libnautilus-private/nautilus-file-operations.c | 13 |
2 files changed, 19 insertions, 1 deletions
@@ -1,3 +1,10 @@ +2004-06-09 Dave Camp <dave@novell.com> + + * libnautilus-private/nautilus-file-operations.c: + (get_next_duplicate_name): Try to convert from the locale + if G_BROKEN_FILENAMES isn't set and the filename isn't valid + utf8. + 2004-06-08 Dave Camp <dave@novell.com> * src/file-manager/fm-list-view.c (fm_list_view_dispose): NULL diff --git a/libnautilus-private/nautilus-file-operations.c b/libnautilus-private/nautilus-file-operations.c index 736b3f9d1..89ea5cad7 100644 --- a/libnautilus-private/nautilus-file-operations.c +++ b/libnautilus-private/nautilus-file-operations.c @@ -1484,8 +1484,19 @@ get_next_duplicate_name (char *name, int count_increment) unescaped_name = g_filename_to_utf8 (unescaped_tmp_name, -1, NULL, NULL, NULL); + if (!unescaped_name) { + /* Couldn't convert to utf8 - probably + * G_BROKEN_FILENAMES not set when it should be. + * Try converting from the locale */ + unescaped_name = g_locale_to_utf8 (unescaped_tmp_name, -1, NULL, NULL, NULL); + + if (!unescaped_name) { + unescaped_name = eel_make_valid_utf8 (unescaped_tmp_name); + } + } + g_free (unescaped_tmp_name); - + unescaped_result = get_duplicate_name (unescaped_name, count_increment); g_free (unescaped_name); |