Bug 7558

Summary: if uim-xim gets "EUC" by XIM_ENCODING_NEGOTIATION, it sends no XIM_COMMIT
Product: UIM Reporter: KIHARA Hideto <deton>
Component: bridge: XIMAssignee: uim-bugs
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high    
Version: unspecified   
Hardware: x86 (IA32)   
OS: Solaris   
Whiteboard:
i915 platform: i915 features:

Description KIHARA Hideto 2006-07-18 05:38:20 UTC
If uim-xim gets "EUC" by XIM_ENCODING_NEGOTIATION (ex. LANG=ja on Solaris10),
uim-xim sends no XIM_COMMIT.
XIM_COMMIT does not appear in uim-xim --trace-xim output
when a string is committed.

When encoding is "EUC", iconv_open() fails and uStringToCtext() returns NULL.

This patch changes XimIM::set_encoding() to make "eucJP"
from 'encoding' and 'mLangRegion' when 'encoding' is "EUC".

diff -ur tmp/uim-1.1.1/xim/ximim.cpp uim-1.1.1/xim/ximim.cpp
--- tmp/uim-1.1.1/xim/ximim.cpp Fri Jul  7 11:16:24 2006
+++ uim-1.1.1/xim/ximim.cpp     Tue Jul 18 08:34:09 2006
@@ -418,7 +418,15 @@
 {
     if (mEncoding)
        free(mEncoding);
-    mEncoding = strdup(encoding);
+    char *p;
+    if (!strcasecmp(encoding, "EUC") && mLangRegion && (p = strchr(mLangRegion, '_'))) {
+       mEncoding = (char *)malloc(3 + strlen(p+1) + 1);
+       if (mEncoding != NULL) {
+           sprintf(mEncoding, "euc%s", p+1);
+       }
+    } else {
+       mEncoding = strdup(encoding);
+    }
 
     // set iconv environment
     if (mLocale)
Comment 1 Etsushi Kato 2006-07-19 07:32:34 UTC
Fixed in r3756.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.