--- file-roller-2.16.3-orig/src/window.c 2007-01-29 23:04:00 +0200 +++ file-roller-2.16.3-orig/src/window.c 2007-02-16 17:41:01 +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 @@ -4368,11 +4385,21 @@ } else window->archive_filename = g_strdup (filename); + char buffer[300]; + char *locale_filename = NULL; + locale_filename = g_filename_from_utf8(window->archive_filename, -1, NULL, NULL, NULL); + if (locale_filename == NULL) { + g_warning(_("Some characters in the filename could not be converted from UTF-8 to locale encoding")); + locale_filename = g_strdup(window->archive_filename); + } + g_snprintf(buffer, 300, "%s", locale_filename); + window->archive_present = FALSE; window->give_focus_to_the_list = TRUE; window_current_action_description_set (window, FR_BATCH_ACTION_OPEN, g_strdup (window->archive_filename), (GFreeFunc) g_free); - success = fr_archive_load (window->archive, window->archive_filename, window->password, &gerror); + // success = fr_archive_load (window->archive, window->archive_filename, window->password, &gerror); + success = fr_archive_load (window->archive, locale_filename, window->password, &gerror); window->add_after_opening = FALSE; if (! success) {