diff options
author | Harry Lu <haip@src.gnome.org> | 2005-11-29 13:57:28 +0800 |
---|---|---|
committer | Harry Lu <haip@src.gnome.org> | 2005-11-29 13:57:28 +0800 |
commit | 32ba5f5d60424e11453da6b01ffcb87323d91ac4 (patch) | |
tree | 8412a7628ea7b18bead116e64b24c0908ac174f6 | |
parent | b58366837b5763f2c90d31998c78d2af72e43e0a (diff) | |
download | gsoc2013-evolution-32ba5f5d60424e11453da6b01ffcb87323d91ac4.tar.gz gsoc2013-evolution-32ba5f5d60424e11453da6b01ffcb87323d91ac4.tar.zst gsoc2013-evolution-32ba5f5d60424e11453da6b01ffcb87323d91ac4.zip |
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.
svn path=/trunk/; revision=30700
-rw-r--r-- | widgets/ChangeLog | 7 | ||||
-rw-r--r-- | widgets/menus/gal-view-collection.c | 8 |
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; |