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 /widgets/menus/gal-view-collection.c | |
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
Diffstat (limited to 'widgets/menus/gal-view-collection.c')
-rw-r--r-- | widgets/menus/gal-view-collection.c | 8 |
1 files changed, 5 insertions, 3 deletions
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; |