Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37857030
en ru br
Репозитории ALT
S:45.0-alt1
5.1: 2.26.0-alt3
4.1: 2.22.2.1-alt1.M41.1
4.0: 2.16.3-alt2
3.0: 2.10.2-alt1
www.altlinux.org/Changes

Группа :: Графические оболочки/GNOME
Пакет: gnome-control-center

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: control-center-dont-encode-to-utf8.diff
Скачать


diff --git a/capplets/keyboard/gnome-keyboard-properties-xkb.c b/capplets/keyboard/gnome-keyboard-properties-xkb.c
index 4ac249d..02f33e5 100644
--- a/capplets/keyboard/gnome-keyboard-properties-xkb.c
+++ b/capplets/keyboard/gnome-keyboard-properties-xkb.c
@@ -48,8 +48,14 @@ char *
 xci_desc_to_utf8 (XklConfigItem * ci)
 {
 	char *sd = g_strstrip (ci->description);
-	return sd[0] == 0 ? g_strdup (ci->name) :
-	    g_locale_to_utf8 (sd, -1, NULL, NULL, NULL);
+	if (sd[0] == 0) {
+		return g_strdup (ci->name);
+	} else if (g_utf8_validate (sd, -1, NULL)) {
+		return g_strdup (sd);
+	} else {
+		/* Old versions of xklavier didn't encode the description in UTF-8 */
+		return g_locale_to_utf8 (sd, -1, NULL, NULL, NULL);
+	}
 }
 
 static void
diff --git a/capplets/keyboard/gnome-keyboard-properties-xkblt.c b/capplets/keyboard/gnome-keyboard-properties-xkblt.c
index 7670968..845a64d 100644
--- a/capplets/keyboard/gnome-keyboard-properties-xkblt.c
+++ b/capplets/keyboard/gnome-keyboard-properties-xkblt.c
@@ -369,10 +369,14 @@ xkb_layout_description_utf8 (const gchar * visible)
 	if (gkbd_keyboard_config_get_descriptions
 	    (config_registry, visible, &sl, &l, &sv, &v))
 		visible = gkbd_keyboard_config_format_full_layout (l, v);
-	v1 = g_strdup (visible);
-	utf_visible =
-	    g_locale_to_utf8 (g_strstrip (v1), -1, NULL, NULL, NULL);
-	g_free (v1);
+	v1 = g_strstrip (g_strdup (visible));
+	if (g_utf8_validate (v1, -1, NULL)) {
+		utf_visible = v1;
+	} else {
+		/* Old versions of xklavier didn't encode the description in UTF-8 */
+		utf_visible = g_locale_to_utf8 (v1, -1, NULL, NULL, NULL);
+		g_free (v1);
+	}
 	return utf_visible;
 }
 
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin