[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: convert-meta and UTF-8
From: |
Herculano de Lima Einloft Neto |
Subject: |
Re: convert-meta and UTF-8 |
Date: |
Tue, 7 Dec 2004 16:19:04 -0200 |
User-agent: |
Mutt/1.5.5.1+cvs20040105i |
On Tue, Dec 07, 2004 at 10:59:55AM -0500, Chet Ramey wrote:
> > Using a terminal which works with real Meta characters instead of an ESC
> > prefix is essential for things like VIM keybindings. Bash and Readline
> > have always dealt well with this to my knowledge, through the
> > convert-meta option. What happens is that while VIM seems to properly
> > recognize characters with an `eighth bit set' in UTF-8, Readline appears
> > quite confused by it. All keybindings based on Meta break when using
> > this setup, since most Meta compositions are seen as, e.g., two M-c
> > M-<char> bytes, and the M-c binding always gets triggered, while the
> > other doesn't seem to. I hope this can be fixed soon enough, otherwise
> > moving to UTF-8 will have to wait.
>
> I'm not sure I understand. You have told readline to strip the eighth
> bit and convert characters with that bit set to escape-prefixed key
> sequences. Why would you expect it not to do that? Or did you turn
> convert-meta off?
Well, I expect it to do that, but realizing that I'm only typing M-a,
for instance, and thus converting it to ESC a. The problem is that in
UTF-8, when I type M-a, what is sent is not a single M-a byte, but
the UTF-8 representation of M-a, which is M-c M-!. Readline gets confused
there, it converts to ESC c and maybe something else, thus breaking all
function bindings in UTF-8.
> This is hard for me to test, because my Mac keyboard converts eight-bit
> characters to escape-prefixed sequences automatically when told to use
> the option key as a meta. By default, though, I can do what you want
> when I turn convert-meta off and explicitly use esc as the meta prefix.
>
> Chet
Best regards,
--
Herculano de Lima Einloft Neto
<hlen@ig.com.br>