aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--widgets/ChangeLog7
-rw-r--r--widgets/menus/gal-view-collection.c8
2 files changed, 12 insertions, 3 deletions
diff --git a/widgets/ChangeLog b/widgets/ChangeLog
index 220dd2a251..5243bf6314 100644
--- a/widgets/ChangeLog
+++ b/widgets/ChangeLog
@@ -1,3 +1,10 @@
+2005-11-29 Simon Zheng <simon.zheng@sun.coma
+
+ * menus/gal-view-collection.c: (gal_view_generate_string):
+ Fix #322311. Using g_utf8_next_char() to traverses UTF-8
+ string and replace characters that are neither a alpha nor
+ a numeral.
+
2005-09-29 Tor Lillqvist <tml@novell.com>
* menus/gal-view-collection.c (load_single_dir)
diff --git a/widgets/menus/gal-view-collection.c b/widgets/menus/gal-view-collection.c
index f894e8cb59..1ee4859ced 100644
--- a/widgets/menus/gal-view-collection.c
+++ b/widgets/menus/gal-view-collection.c
@@ -107,9 +107,11 @@ gal_view_generate_string (GalViewCollection *collection,
ret_val = g_strdup(gal_view_get_title(view));
else
ret_val = g_strdup_printf("%s_%d", gal_view_get_title(view), which);
- for (pointer = ret_val; *pointer; pointer++) {
- if (!isalnum((guint) *pointer)) {
- *pointer = '_';
+ for (pointer = ret_val; *pointer; pointer = g_utf8_next_char(pointer)) {
+ if (!g_unichar_isalnum(g_utf8_get_char(pointer))) {
+ char *ptr = pointer;
+ for (; ptr < g_utf8_next_char(pointer); *ptr = '_', ptr++)
+ ;
}
}
return ret_val;