[gnome-control-center] Fix handling of multichar splitting for regions
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] Fix handling of multichar splitting for regions
- Date: Wed, 26 Jan 2011 01:39:22 +0000 (UTC)
commit 2c4bba74e07405205b22c684b3822d13aa429ea7
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Jan 25 20:37:01 2011 -0500
Fix handling of multichar splitting for regions
g_strsplit_set is not the right thing to use with multibyte
characters. GRegex to the rescue. This was causing misrendering
and crashes in Chinese:
https://bugzilla.redhat.com/show_bug.cgi?id=669415
Also, we have to call bind_textdomain_codeset().
panels/datetime/cc-datetime-panel.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/panels/datetime/cc-datetime-panel.c b/panels/datetime/cc-datetime-panel.c
index 55ccca2..c35425c 100644
--- a/panels/datetime/cc-datetime-panel.c
+++ b/panels/datetime/cc-datetime-panel.c
@@ -518,7 +518,7 @@ get_regions (TzLocation *loc,
/* Load the translation for it */
zone = g_strdup (dgettext (GETTEXT_PACKAGE_TIMEZONES, loc->zone));
g_strdelimit (zone, "_", ' ');
- split_translated = g_strsplit_set (zone, TRANSLATION_SPLIT, 2);
+ split_translated = g_regex_split_simple ("[\\x{2044}\\x{2215}\\x{29f8}\\x{ff0f}/]", zone, 0, 0);
g_free (zone);
if (!g_hash_table_lookup_extended (data->table, split[0], NULL, NULL))
@@ -844,6 +844,8 @@ cc_date_time_panel_init (CcDateTimePanel *self)
void
cc_date_time_panel_register (GIOModule *module)
{
+ bind_textdomain_codeset (GETTEXT_PACKAGE_TIMEZONES, "UTF-8");
+
cc_date_time_panel_register_type (G_TYPE_MODULE (module));
g_io_extension_point_implement (CC_SHELL_PANEL_EXTENSION_POINT,
CC_TYPE_DATE_TIME_PANEL,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]