Andries Brouwer wrote:
> From: Roozbeh Pournader <[EMAIL PROTECTED]>
>
> On Thu, 15 Feb 2001, Markus Kuhn wrote:
>
> > Recommendation: Use neither "ESC ( K" nor CSI in your application
> > software.
>
> Question: What kind of replacement should I use? I want something that's
> available on all current Linux consoles.
>
> There were two recommendations:
>
> 1) Don't use CSI.
> I tend to agree - there is not really any reason to use this
> instead of ESC [. I wonder whether there is anything that
> uses it. Maybe it can just be removed from the kernel console.c.
>
> 2) Don't use ESC ( K.
> That makes the use of fonts with embedded Unicode glyph maps
> impossible, unless you put the console into UTF-8 mode.
What direction are we talking about: From terminal to application or the other
way around?
>From application to terminal, you can use ESC [ instead of CSI without any
side effect that I know of.
>From terminal to application there is a problem: The ESC could be typed or
could be the start of an escape sequence. This is especially a problem for Vi
(or Vim), because ESC is used to get out of Insert mode. The difference
between a typed ESC and the start of an escape sequence can only be guessed by
using a timeout.
Using the CSI instead of ESC [ is a great help for avoiding this confusion.
Unfortunately, this implies that CSI (0x9b) cannot be used for a character.
More detailed: 0x9b cannot be used for the start of a character.
And since UTF-8 includes 0x9b bytes only as a trailing byte, it would still be
possible to use a single CSI byte. The application has to be clever enough to
know that this is not an illegal UTF-8 byte sequence.
If you want to use 8 bit encodings (like latin1), 0x9b is a valid character,
and you are forced to use ESC sequences...
--
ARTHUR: I am your king!
WOMAN: Well, I didn't vote for you.
ARTHUR: You don't vote for kings.
WOMAN: Well, 'ow did you become king then?
The Quest for the Holy Grail (Monty Python)
/// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.moolenaar.net \\\
((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
\\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
-
Linux-UTF8: i18n of Linux on all levels
Archive: http://mail.nl.linux.org/lists/