Bug 7558 - if uim-xim gets "EUC" by XIM_ENCODING_NEGOTIATION, it sends no XIM_COMMIT
Summary: if uim-xim gets "EUC" by XIM_ENCODING_NEGOTIATION, it sends no XIM_COMMIT
Status: RESOLVED FIXED
Alias: None
Product: UIM
Classification: Unclassified
Component: bridge: XIM (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Solaris
: high normal
Assignee: uim-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-18 05:38 UTC by KIHARA Hideto
Modified: 2006-07-19 07:32 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

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.