bug-gnu-emacs
[Top][All Lists]
Advanced

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

Re: utf-8 input under X11


From: Gerd Moellmann
Subject: Re: utf-8 input under X11
Date: 26 Oct 2001 19:36:49 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1.50

"Eli Zaretskii" <eliz@is.elta.co.il> writes:

> I think Gerd was mistaken.  locale-coding-system indeed has no
> influence on decoding of keyboard input.  The doc string is correct,
> AFAIK: it only influences the messages produced by strerror, perror,
> and other similar facilities.  Unless _I_ am mistaken, that is ;-)

I'm afraid you are mistaken :-).

Locale-coding-system is used in XTread_socket to decode what
XmbLookupString returns, which is the translation of a keysym to a
string of bytes encoded depending on the current locale.  That the
result of XmbLookupString is encoded locale-dependent is probably the
reason why locale-coding-system has been used here.  I can only agree
that locele-coding-system coming into play here on X is confusing from
a user's perspective.

> > I don't think it's a MULE issue, really, but rather a weirdness in 
> > the routines decoding X11 keyboard input.
> 
> I think you are right, especially since you told in the beginning of
> this thread that Unicode input works for you in "emacs -nw".

That it works -nw is not that surprising, actually.  This case decodes
input differently, and uses keyboard-coding-system of course.

To summarize, the issues with the decoding code in XTread_socket are

 o Should it use locale-coding-system?

 o Should that be set up for UTF-8 locales?

 o Should set-keyboard-coding-system tell XTread_socket how to decode
   X input?

 o Why does decode_coding for a nil locale-coding-system return a
   number of chars produced that's different from the number of chars
   actually in its output buffer, given the number of bytes it
   returns.

 o Why does decoding_coding for locale-coding-system `utf-8' not
   decode some characters (I forget at present which ones.)

Sounds like MULE issues to me.

> > X11 -keysyms-> Xlib -UTF-8-> Emacs X11 interface -> extra keyboard 
> > decoding (Mule)
> > and the problem is in the Emacs/X11 interface.
> 
> Probably.  

It's working a bit differently than the picture suggests:

The X server gets keyboard input from the user.  It transfers this
input to the client program (Emacs) in form of KeyPress events
containing keysyms (because that's portable across locales.)  The
client translates the keysyms to something encoded in its locale
(XmbLookupString for example).

Then Emacs comes into play in that it decodes the result of
XmbLookupString into its internal form.  And that's where the bug(s)
sit.



reply via email to

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