Re: Xterm now has UTF-8 support

From: Markus Kuhn (Markus.Kuhn@cl.cam.ac.uk)
Date: Tue Jun 29 1999 - 06:39:29 EDT


Ricardo Bermell-Benet wrote on 1999-06-29 08:59 UTC:
> 2) the X-Windows compose function does not work at all with this xterm

Probably. Look at the Input() function in input.c to see what we have
done. We do map all keycodes to Unicode characters via a table lookup,
unless XLookupString provides us with a Latin-1 character. All this is
just a temporary hack, until someone implements a UTF-8 locale and input
method in the XFree86 Xlib and we can get the entered characters
directly out of XmbLookupString. In UTF-8 mode, we use only
XLookupString as it is supposed to guarantee ISO 8859-1 output, and then
we convert this in xterm to UTF-8. Perhaps on your system, the compose
key works only with XmbLookupString, which we have not used in UTF-8
mode, because it provides locale dependent output, which would be fine
if there were a UTF-8 locale that we could select, but which is
problematic if someone uses a non-Latin-1 locale whose output we would
then misinterpret as Latin-1 and feed into the UTF-8 conversion.

What platform are you using?

> As a temporary patch, i had to remap my keyboard with xmodmap, so i
> type ('AltGr' plus 'a') instead of ('accent key', then 'a').

That should work and is what I recommend. If you are interested in a
more permanent fix, try to work your work through all the locale aspects
of the X Input Method in Xlib and see whether you can build UTF-8 in
there directly. There is some ancient UTF-1 prototype code left that you
might find helpful as a template.

It seems that Sun, SCO, Compaq, and IBM have already all independently
built UTF-8 support into their Xlib versions. It would be very nice if
they could unify this and donate it to X.Org or XFree86 such that we can
finally use it in an open and portable way.

Markus

-- 
Markus G. Kuhn, Computer Laboratory, University of Cambridge, UK
Email: mkuhn at acm.org,  WWW: <http://www.cl.cam.ac.uk/~mgk25/>



This archive was generated by hypermail 2.1.2 : Tue Jul 10 2001 - 17:20:47 EDT