[evolution-patches] [Calendar] Fix for #333704



Hi,

Bug 333704 - Localized categories list in appointment editor is corrupt
on solaris.
http://bugzilla.gnome.org/show_bug.cgi?id=333704

Because the passing text is in utf-8 encoding, we should traverse it by
utf-8 char order rather than one by one byte.

Sending patch for review.

Thanks,
-Simon
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.3011
diff -u -p -r1.3011 ChangeLog
--- ChangeLog	6 Mar 2006 15:58:53 -0000	1.3011
+++ ChangeLog	7 Mar 2006 07:44:21 -0000
@@ -1,3 +1,10 @@
+2006-03-07  Simon Zheng  <simon zheng sun com>
+
+	Fixes bug #333704
+	* gui/dialogs/comp-editor-util.c: (comp_editor_strip_categories):
+	Because the passing text is in UTF-8 encoding, it should be traversed 
+	by utf-8 char order rather than one by one byte. 
+
 2006-03-06  Veerapuram Varadhan  <vvaradhan novell com>
 
 	**Fixes #321832
Index: gui/dialogs/comp-editor-util.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/comp-editor-util.c,v
retrieving revision 1.34
diff -u -p -r1.34 comp-editor-util.c
--- gui/dialogs/comp-editor-util.c	24 Nov 2005 15:11:50 -0000	1.34
+++ gui/dialogs/comp-editor-util.c	7 Mar 2006 07:44:21 -0000
@@ -303,12 +303,12 @@ comp_editor_strip_categories (const char
 	start = end = NULL;
 	new_p = new_categories;
 
-	for (p = categories; *p; p++) {
-		int c;
+	for (p = categories; *p; p = g_utf8_next_char (p)) {
+		gunichar c;
 
-		c = *p;
+		c = g_utf8_get_char (p);
 
-		if (isspace (c))
+		if (g_unichar_isspace (c))
 			continue;
 		else if (c == ',') {
 			int len;
@@ -329,7 +329,7 @@ comp_editor_strip_categories (const char
 				start = p;
 				end = p;
 			} else
-				end = p;
+				end = g_utf8_next_char(p) - 1;	
 		}
 	}
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]