[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][TOP]

PATCH: GAL Fixed XIM and I18N for Evo


たごうです.

Evolutionで日本語表示および日本語入力が全く出来ない問題を解決
するためのパッチです.GALにあててください.
ちなみにCVS用です.
一応upstreamには投げてます.

--
Akira TAGOH :: at@xxxxxxxxx
               tagoh@xxxxxxxxxxx  / Japan GNOME Users Group
               tagoh@xxxxxxxxxxxx / GNOME-DB Project
               tagoh@xxxxxxxxxx   / Red Hat, Inc.
diff -ruN gal.orig/gal/widgets/e-font.c gal/gal/widgets/e-font.c
--- gal.orig/gal/widgets/e-font.c	Mon Jan 22 15:49:13 2001
+++ gal/gal/widgets/e-font.c	Mon Jan 22 15:49:24 2001
@@ -198,18 +198,25 @@
 	}
 
 	if (gdkfont->type == GDK_FONT_FONTSET) {
+		gchar *xlocale[] = {	"ja_JP.euc", "ja_JP.ujis",
+					"zh_CN.GB2312", "zh_TW.Big5",
+					"ko_KR.eucKR", NULL};
 		char * fslocale;
+		int i;
+
 		fslocale = XLocaleOfFontSet (GDK_FONT_XFONT (gdkfont));
 		/* fixme: Whoever uses CJK locales should check that */
-		if (!strcmp (fslocale, "FIXME")) {
-			/* We need fontset */
-			font = e_font_from_gdk_fontset (gdkfont);
-			/* Insert into cache */
-			if (e_cache_insert (cache, keyfont, font, 1)) {
-				/* Inserted, so add cache ref manually */
-				e_font_ref (font);
+		for (i = 0; xlocale[i] != NULL; i++) {
+			if ( g_strncasecmp (fslocale, xlocale[i], strlen (xlocale[i])) == 0) {
+				/* We need fontset */
+				font = e_font_from_gdk_fontset (gdkfont);
+				/* Insert into cache */
+				if (e_cache_insert (cache, keyfont, font, 1)) {
+					/* Inserted, so add cache ref manually */
+					e_font_ref (font);
+				}
+				return font;
 			}
-			return font;
 		}
 	}
 
@@ -798,6 +805,8 @@
 		g_hash_table_insert (eh, "iso_10646-1", "UTF-16");
 		g_hash_table_insert (eh, "koi8-r", "koi8-r");
 		g_hash_table_insert (eh, "koi8-ub", "koi8-ub");
+		g_hash_table_insert (eh, "eucjp", "EUC-JP");
+		g_hash_table_insert (eh, "ujis", "EUC-JP");
 	}
 
 	strncpy (e, encoding, 64);
diff -ruN gal.orig/gal/widgets/e-unicode.c gal/gal/widgets/e-unicode.c
--- gal.orig/gal/widgets/e-unicode.c	Mon Jan 22 15:49:13 2001
+++ gal/gal/widgets/e-unicode.c	Mon Jan 22 15:49:24 2001
@@ -16,6 +16,7 @@
 #include <iconv.h>
 #include <gdk/gdk.h>
 #include <gdk/gdkx.h>
+#include <gdk/gdkkeysyms.h>
 #include "e-unicode.h"
 #include "e-font.h"
 
@@ -186,15 +187,19 @@
 	gchar *utf;
 	gint unilen;
 
-	unival = gdk_keyval_to_unicode (keyval);
+	if (keyval == GDK_VoidSymbol) {
+		utf = e_utf8_from_gtk_string (widget, string);
+	} else {
+		unival = gdk_keyval_to_unicode (keyval);
 
-	if (unival < ' ') return NULL;
+		if (unival < ' ') return NULL;
 
-	utf = g_new (gchar, 7);
+		utf = g_new (gchar, 7);
 
-	unilen = g_unichar_to_utf8 (unival, utf);
+		unilen = g_unichar_to_utf8 (unival, utf);
 
-	utf[unilen] = '\0';
+		utf[unilen] = '\0';
+	}
 
 	return utf;
 }