emacs-devel
[Top][All Lists]
Advanced

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

Re: Please avoid using Xutf8* API.


From: Hideki Hiura
Subject: Re: Please avoid using Xutf8* API.
Date: Sun, 28 Apr 2002 16:54:37 -0700 (PDT)

> From: "Stefan Monnier" <monnier+gnu/address@hidden>
> 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.

--
address@hidden,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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]