[Top][All Lists]

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

Re: utf-8 input under X11

From: Eli Zaretskii
Subject: Re: utf-8 input under X11
Date: Mon, 29 Oct 2001 11:58:52 +0200 (IST)

On Mon, 29 Oct 2001, David Monniaux wrote:

> > if (nbytes == nchars)
> >   c = copy_bufptr[i], len = 1;
> > else
> >   c = STRING_CHAR_AND_LENGTH (copy_bufptr + i, nbytes - i, len);
> > Could you change the code as above, and try again without
> > setting locale-coding-system to utf-8?
> It just works, whether or not locale-coding-system is set to utf-8.

Thanks for testing this.

> 1/ If running in an UTF-8 locale, Emacs should set automatically 
> locale-coding-system to utf-8, as it does for ISO-8859-1 (it sets the 
> variable to iso-latin-1).

I think we should exercise some care here, lest we break more things 
than we fix.  Is it guaranteed that in such a locale, the X keyboard 
works like on your system, or are there other factors that could 
influence that?

Since using UTF-8 input automatically means all non-ASCII characters in 
your buffers belong to the mule-unicode-* character sets, we effectively 
limit users to files in either UTF-8 or Latin-1.  They will not be able, 
for example, produce KOI8-R or Latin-3, unless they either install add-on 
packages such as Mule-UCS or otherwise modify the code which encodes and 
decodes characters.  And if they mix characters from files encoded in 
anything but UTF-8 or Latin-1 with what they type, Emacs will confuse 
them by refusing to save the result in UTF-8.  This is because currently, 
mule-unicode-* characters are treated as disjoint from the other 
character sets supported by Emacs.

If UTF-8 input is the only reasonable input mode in such locales, then 
using it would be a lesser evil than any other alternative.  But if users 
can reasonably use other input encoding, we might be preventing them from 
having a more useful Emacs.

(Also, the Windows port will probably need some special considerations,
since it sounds like it doesn't use the locale coding system in the same 
way as X does.)

> 2/ If locale-coding-system is utf-8, Emacs should decode keyboard 
> input as utf-8 (this looks like it has something to do with the code 
> around line 10573). I don't see why the user should have to do 
> something special (like set-keyboard-coding-system) if using utf-8, 
> but not if using koi8-r !

See above: the reason is that Unicode support is not yet complete enough, 
so perhaps we shouldn't yet force it on the user.

> 3/ The documentation for locale-coding-system should reflect this 
> role, since the current documentation only talks of "system messages".

I agree.  I will fix that.

reply via email to

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