all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Stefan Monnier" <monnier+gnu/emacs@RUM.cs.yale.edu>
Cc: emacs-devel@gnu.org, hiura@li18nux.org
Subject: Re: Please avoid using Xutf8* API.
Date: Fri, 26 Apr 2002 13:41:19 -0400	[thread overview]
Message-ID: <200204261741.g3QHfJj30681@rum.cs.yale.edu> (raw)
In-Reply-To: u7kmu4dcj.fsf@MILCH.meadowy.org

> 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.
	  <switch to utf-8 version of the same locale>
	  XmbLookupString(...)
	  <switch back to the original locale>
	}

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

  reply	other threads:[~2002-04-26 17:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-26 16:46 Please avoid using Xutf8* API MIYASHITA Hisashi
2002-04-26 17:41 ` Stefan Monnier [this message]
2002-04-27 19:29   ` MIYASHITA Hisashi
2002-04-28 23:25     ` Stefan Monnier
2002-04-28 23:54       ` Hideki Hiura

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200204261741.g3QHfJj30681@rum.cs.yale.edu \
    --to=monnier+gnu/emacs@rum.cs.yale.edu \
    --cc=emacs-devel@gnu.org \
    --cc=hiura@li18nux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.