Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Multibyte characters and menu completion



	Hi Peter :)

 * Peter Stephenson <pws@xxxxxxx> dixit:
> On Sun, 18 Nov 2007 21:37:57 +0100 DervishD <zsh@xxxxxxxxxxxx> wrote:
> > But if the character code point is greater than U+00FF, weird things
> > happen. For example, I have a file named U+8336 (kanji for "tea")
> > followed by U+306e (hiragana "no") followed by U+5473 (kanji for
> > odor/smell) and zsh prints the name correctly (well, since I'm in a
> > text mode terminal, it uses three instances of my "unknown
> > character" glyph, but thinks that each letter is three glyphs wide,
> > putting the cursor six spaces after the file name once it is
> > completed:
> 
> I just tried these characters on my gnome-terminal (which seems to
> have the best multibyte support of the limited number of terminals
> I've tried) and they work OK.

Thanks A LOT for having tested that, Peter :) Any terminal emulator I've
tested works OK, the problem happened only in Linux virtual terminals,
that's why I asked (as I told, I seriously doubted that the problem was
a zsh one, but since it appeared with zsh I thought that somebody would
have had the same problem and could tell me if it was my fault, my
terminal fault or zsh's fault).

> They're two glyphs wide in this case, and the shell is handling
> this correctly.  I think your terminal is probably problematic.

Yes, but I haven't had any confirmation from the kernel people. I will
have to ask again, although I'm afraid this issue can't and won't be
fixed: presentation should be done in userspace. The kernel already does
a great job allowing the use of UTF-8 for Unicode chars below U+00FF
directly.

> It's not entirely trivial turning on all the bits you need to get
> multibyte characters working.  There's some guidance in the FAQ
> (section 5.3).

Zsh works ok in X terminals with UTF-8 support, for what I've tested.
Under Linux VT things are different. The VT itself supports UTF-8 and it
is in UTF-8 mode, I've made sure of it, but presenting characters
correctly is something that a terminal emulator should do in userspace.
I think the same, except there aren't many terminal emulators for the
console ;) and dealing with Unicode chars can be tricky (there are a
very limited number of glyphs in the console, and composing chars are a
problem).

Well, just knowing that zsh is behaving OK is enough. I suppose I must
face the fact that if I want to use the console I won't be able to use
Unicode chars greater than U+00FF...

Again, thanks a lot :))

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!
We are waiting for 13 Feb 2009 23:31:30 +0000 ...



Messages sorted by: Reverse Date, Date, Thread, Author