From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: Please avoid using Xutf8* API. Date: Fri, 26 Apr 2002 13:41:19 -0400 Sender: emacs-devel-admin@gnu.org Message-ID: <200204261741.g3QHfJj30681@rum.cs.yale.edu> References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1019842953 709 127.0.0.1 (26 Apr 2002 17:42:33 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 26 Apr 2002 17:42:33 +0000 (UTC) Cc: 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 1719jt-0000BK-00 for ; Fri, 26 Apr 2002 19:42:33 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 1719md-0006hb-00 for ; Fri, 26 Apr 2002 19:45:23 +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 1719jq-0001sz-00; Fri, 26 Apr 2002 13:42:30 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 1719in-0001py-00 for ; Fri, 26 Apr 2002 13:41:26 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id g3QHfJj30681; Fri, 26 Apr 2002 13:41:19 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: MIYASHITA Hisashi (=?ISO-2022-JP?B?GyRCNVwyPBsoQiAbJEI+MBsoQjpISU1J?=) 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:3317 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:3317 > Xutf8* APIs was suddenly introduced into XFree86 abruptly without > concensus. After the developper noticed the change, there had been > tremendous discussions including flames to revoke these APIs. OK! I'll remove the change, then (it was somewhat experimental anyway). Note that it's conditionalized on X_HAVE_UTF8_STRING. Thanks for warning us about the problem. > I couldn't find the discussions that corresponds to this change > in emacs-devel ML, but from ChangeLog, this change seems to be > introduced on 4/16. Could you please teach us why do you need > this change, Mr.Monnier? The reason is basically as follows: let's say your locale is fr_CH.iso-8859-1 and you use xmodmap to bind some keycode to EuroSign. Clearly XmbLookupString can't return a string containing the euro char since it has to return an iso-8859-1 string (where the euro char doesn't exist). So we if XmbLookupString didn't return a string, we try again with Xutf8LookupString which gives us the euro char (in utf-8). Maybe an alternative would be to replace Xutf8LookupString with XmbLookupString(...) if (status_return == XLookupKeySym) { ;; Try again with unicode. XmbLookupString(...) } but my X (and locale) programming knowledge is about as good as inexistent so I have no idea how to do the switches. Also we'd need to be sure that doing the locale-switches and the additional call to XmbLookupString doesn't mess up any internal state. This seemed to work with Xutf8LookupString, although we couldn't find any doc that guarantees it. Stefan