From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: hiura@li18nux.org (Hideki Hiura) Newsgroups: gmane.emacs.devel Subject: Re: Please avoid using Xutf8* API. Date: Sun, 28 Apr 2002 16:54:37 -0700 (PDT) Sender: emacs-devel-admin@gnu.org Message-ID: References: <200204261741.g3QHfJj30681@rum.cs.yale.edu> <200204282325.g3SNP0a13474@rum.cs.yale.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1020038268 22839 127.0.0.1 (28 Apr 2002 23:57:48 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 28 Apr 2002 23:57:48 +0000 (UTC) Cc: himi@m17n.org, emacs-devel@gnu.org, hiura@li18nux.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 171yY8-0005wG-00 for ; Mon, 29 Apr 2002 01:57:48 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 171ybd-000565-00 for ; Mon, 29 Apr 2002 02:01:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 171yXb-0006sl-00; Sun, 28 Apr 2002 19:57:15 -0400 Original-Received: from nwkea-mail-2.sun.com ([192.18.42.14]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 171yUy-0006iI-00 for ; Sun, 28 Apr 2002 19:54:32 -0400 Original-Received: from engmail1.Eng.Sun.COM ([129.146.1.13]) by nwkea-mail-2.sun.com (8.9.3+Sun/8.9.3) with ESMTP id QAA10319; Sun, 28 Apr 2002 16:54:22 -0700 (PDT) Original-Received: from bakabon.eng.sun.com (bakabon.Eng.Sun.COM [129.146.76.173]) by engmail1.Eng.Sun.COM (8.9.3+Sun/8.9.3/ENSMAIL,v2.1p1) with ESMTP id QAA07279; Sun, 28 Apr 2002 16:54:21 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by bakabon.eng.sun.com (8.9.3+Sun/8.9.3) with ESMTP id QAA22569; Sun, 28 Apr 2002 16:54:38 -0700 (PDT) Original-To: monnier+gnu/emacs@rum.cs.yale.edu In-Reply-To: <200204282325.g3SNP0a13474@rum.cs.yale.edu> X-Mailer: Mew version 1.95b43 on Emacs 20.7 / Mule 4.1 (AOI) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:3367 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:3367 > From: "Stefan Monnier" > Right, but since we currently do not support UTF-8 fully, we cannot > rely on it. We have to use the "orig" locale and only revert to > UTF-8 when the orig locale failed. How about something mixture of both approach then? orig_locale = SetLocale(LC_CTYPE, NULL); utf8_locale = get_utf_8_codeset_locale_name(orig); orig_xim = XOpenIM (dpyinfo->display, dpyinfo->xrdb, resource_name, EMACS_CLASS); orig_xic = XCreateIC(orig_xim, .....); setlocale(LC_CTYPE, utf8_locale); utf8_xim = XOpenIM (dpyinfo->display, dpyinfo->xrdb, resource_name, EMACS_CLASS); utf8_xic = XCreateIC(utf8_xim, .....); setlocale(LC_CTYPE, orig_locale); XmbLookupString(orig_xic...) if (status_return == XLookupKeySym) { ;; Try again with xic created on UTF-8 locale setlocale(LC_CTYPE, utf8_locale); just in case for XLC function XmbLookupString(utf8_xic...) setlocale(LC_CTYPE, orig_locale); I have not verified this code would work with current implementation. Or if the short term goal is to convert KeySym of Euro sign to the Euro sign string, or something like such level(means that the case XIM server does not get involved with), there may be an alternative. -- hiura@{li18nux.org,sun.com,kondara.org,unicode.org} http://www.li18nux.org Chair, Li18nux/Linux Internationalization Initiative, Free Standards Group Architect/Sr. Staff Engineer, Sun Microsystems, Inc, USA FAX 650-786-9553