|
该文件源码如下:
diff -u nautilus-2.4.1/libnautilus-private/nautilus-file.c nautilus-2.4.1-locale/libnautilus-private/nautilus-file.c
--- nautilus-2.4.1/libnautilus-private/nautilus-file.c 2003-09-19 19:28:07.000000000 +0800
+++ nautilus-2.4.1-locale/libnautilus-private/nautilus-file.c 2003-10-22 14:11:09.000000000 +0800
@@ -2407,20 +2407,21 @@
* thing with any local filename that does not
* validate as good UTF-8.
*/
- if (has_local_path (file)) {
- broken_filenames = have_broken_filenames ();
- if (broken_filenames || !g_utf8_validate (name, -1, NULL)) {
- utf8_name = g_locale_to_utf8 (name, -1, NULL, NULL, NULL);
- if (utf8_name != NULL) {
- g_free (name);
- name = utf8_name;
- /* Guaranteed to be correct utf8 here */
- validated = TRUE;
- }
- } else if (!broken_filenames) {
- /* name was valid, no need to re-validate */
+ broken_filenames = have_broken_filenames ();
+ if (broken_filenames || !g_utf8_validate (name, -1, NULL)) {
+ utf8_name = g_locale_to_utf8 (name, -1, NULL, NULL, NULL);
+ if (utf8_name != NULL) {
+ g_free (name);
+ name = utf8_name;
+ /* Guaranteed to be correct utf8 here */
validated = TRUE;
}
+ } else if (!broken_filenames) {
+ /* name was valid, no need to re-validate */
+ validated = TRUE;
+ }
+
+ if (has_local_path (file)) {
} else if (strcmp (name, "/") == 0) {
/* Special-case the display name for roots that are not local files */
g_free (name);
diff -u nautilus-2.4.1/libnautilus-private/nautilus-file-operations-progress.c nautilus-2.4.1-locale/libnautilus-private/nautilus-file-operations-progress.c
--- nautilus-2.4.1/libnautilus-private/nautilus-file-operations-progress.c 2003-02-28 23:14:57.000000000 +0800
+++ nautilus-2.4.1-locale/libnautilus-private/nautilus-file-operations-progress.c 2003-10-22 16:39:01.000000000 +0800
@@ -162,8 +162,19 @@
return;
}
+ printf("text: %s ", text);
unescaped_text = gnome_vfs_unescape_string_for_display (text);
+ printf("unescaped: %s ", unescaped_text);
+ if (!g_utf8_validate(unescaped_text, -1, NULL)) {
+ char *convert;
+ convert = g_locale_to_utf8 (unescaped_text, -1, NULL, NULL, NULL);
+ if (convert != NULL) {
+ g_free (unescaped_text);
+ unescaped_text = convert;
+ }
+ }
unescaped_utf8 = eel_make_valid_utf8 (unescaped_text);
+ printf("utf8: %s\n\r", unescaped_utf;
eel_ellipsizing_label_set_text (label, unescaped_utf;
g_free (unescaped_utf;
g_free (unescaped_text); |
|