summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Camp <dave@novell.com>2004-06-09 20:27:30 +0000
committerDave Camp <campd@src.gnome.org>2004-06-09 20:27:30 +0000
commit145be194b00aa0d705d331ea4b5f66232c1f1f45 (patch)
treefca1cededad910b10eae548f816bfbc454a10eeb
parent5199091f53c2da3501350deb91218426f3afa534 (diff)
downloadnautilus-145be194b00aa0d705d331ea4b5f66232c1f1f45.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--ChangeLog7
-rw-r--r--libnautilus-private/nautilus-file-operations.c13
2 files changed, 19 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 969bfd65e..36140a39b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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-02 Martin Wehner <martin.wehner@epost.de>
* src/file-manager/fm-directory-view.c:
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);