[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: UTF-8 curses
> Double-width chars: I think it's clear that these fill two character
> cells, and if you overwrite one of the cells, then the other should be
> replaced by a space in the same colour as the double-width character
> just destroyed. A really nasty case is when you receive one of these
> characters when the cursor is in the last column.
>
> This case is nasty, because a program might want to avoid wrapping
> onto the next line, and perhaps even causing the screen to scroll, by
> outputing UTF-8 octets while watching which column the cursor is in.
> If you're on the last column, you think it's safe to continue, but
> then you suddenly find you've trashed the next line, and perhaps the
> whole screen because of scrolling.
>
This kind of question comes up a lot and I can't provide a definitive
answer, but I should point out that these questions must have been
tackled as far back as the mid-80s in the Japanese VT emulators that
supported halfwidth (i.e. single-width) Roman and Katakana alongside
full-width (i.e. double-width) Kanji.
In fact our own emulator for DOS, MS-DOS Kermit, handles the situation
to the satisfaction of Japanese users. See:
http://www.columbia.edu/kermit/kanji.html
but the code for that part was written in Japan and I don't pretend to
know the details of what happens in the borderline cases.
- Frank
-
Linux-UTF8: i18n of Linux on all levels
Archive: http://mail.nl.linux.org/lists/