diff -Naur file-roller-2.16.3-orig/src/window.c file-roller-2.16.3/src/window.c --- file-roller-2.16.3-orig/src/window.c 2007-01-29 23:04:00 +0200 +++ file-roller-2.16.3/src/window.c 2007-02-16 15:16:15 +0200 @@ -1139,6 +1139,21 @@ _window_update_current_location (FRWindow *window) { const char *current_dir = window_get_current_location (window); + /* non-8bit path handling roughly borrowed from Dia; + * thanks an example/docs by Vitaly Lipatov (etersoft.ru) + */ + char buffer[300]; + char *utf8current_dir = NULL; + + if (!g_utf8_validate(current_dir, -1, NULL)) { + utf8current_dir = g_filename_to_utf8(current_dir, -1, NULL, NULL, NULL); + if (utf8current_dir == NULL) { + g_warning(_("Some characters in the current path are neither UTF-8 nor your local encoding")); + } + } + if (utf8current_dir == NULL) + utf8current_dir = g_strdup(current_dir); + g_snprintf(buffer, 300, "%s", utf8current_dir); if (window->list_mode == WINDOW_LIST_MODE_FLAT) { gtk_widget_hide (window->location_bar); @@ -1147,14 +1162,16 @@ gtk_widget_show (window->location_bar); - gtk_entry_set_text (GTK_ENTRY (window->location_entry), window->archive_present? current_dir: ""); + gtk_entry_set_text (GTK_ENTRY (window->location_entry), window->archive_present? utf8current_dir: ""); gtk_widget_set_sensitive (window->home_button, window->archive_present); - gtk_widget_set_sensitive (window->up_button, window->archive_present && (current_dir != NULL) && (strcmp (current_dir, "/") != 0)); - gtk_widget_set_sensitive (window->back_button, window->archive_present && (current_dir != NULL) && (window->history_current != NULL) && (window->history_current->next != NULL)); - gtk_widget_set_sensitive (window->fwd_button, window->archive_present && (current_dir != NULL) && (window->history_current != NULL) && (window->history_current->prev != NULL)); + gtk_widget_set_sensitive (window->up_button, window->archive_present && (utf8current_dir != NULL) && (strcmp (utf8current_dir, "/") != 0)); + gtk_widget_set_sensitive (window->back_button, window->archive_present && (utf8current_dir != NULL) && (window->history_current != NULL) && (window->history_current->next != NULL)); + gtk_widget_set_sensitive (window->fwd_button, window->archive_present && (utf8current_dir != NULL) && (window->history_current != NULL) && (window->history_current->prev != NULL)); gtk_widget_set_sensitive (window->location_entry, window->archive_present); gtk_widget_set_sensitive (window->location_label, window->archive_present); + g_free(utf8current_dir); + #if 0 _window_history_print (window); #endif