Bruno Haible wrote on 2001-05-15 13:10 UTC:
> Markus Kuhn writes:
> > I'd like to have in some standard tool a function that looks at
> > nl_langinfo(CODESET) and then sends out the corresponding ISO 2022
> > sequence to make sure the terminal knaows about the encoding of the
> > current locale.
> 
> You can't have that. Why? All ISO 2022 escape sequences must be
> registered at the ISO-IR registry. But some widely used encodings,
> such as BIG5, BIG5HKSCS, GB18030, CP1251, are not ISO standardized and
> thus have no such escape sequence.

It works fine for ISO encodings at least (and people shouldn't be using
anything else anyway ;-). CP1251, KOI8-R, etc. have the CSI problem and
are a bad choice for terminal emulator usage anyway.

In addition, ISO 2022 has provisions for

  a) signalling your own private 94 and 96 character maps
     (but all the useful ones have already been registered really)
  b) signaling that you leave ISO 2022 to your own private
     ISO 2022-incompatible encoding (which allows you to signal
     even CP1252, BIG5, GB18030, and similar diseases) properly

In any case, I don't really care at all about full ISO 2022 support for
any imaginable encoding. I really just want a simple mechanism to keep
locale and terminal in sync for those users who use both ISO 8859 and
UTF-8 for some interim period before a permanent adoption of UTF-8
becomes feasible. Whether there is an ISO 2022 sequence for BIG5 or not
is completely irrelevant in that context. The tool would simply output
nothing if the locale isn't ISO 8859 or UTF-8. For BIG5 etc. users,
nothing would change.

Markus

-- 
Markus G. Kuhn, Computer Laboratory, University of Cambridge, UK
Email: mkuhn at acm.org,  WWW: <http://www.cl.cam.ac.uk/~mgk25/>

-
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/lists/

Reply via email to