Hello,

I've been puzzling over the implementation of ISO 2022 support for
XTerm.  The problem is simple: we don't want to implement ISO 2022 (it's
a monster), and we do want to implement ISO 2022 (people need it).

I think therefore that we need to find a way to make XTerm support 
ISO 2022 without bloating it with dozens of mapping tables.  But then,
we already have the necessary mapping tables in the form of font
encodings.  Font encodings should be loaded lazily, so that you don't
pay for encodings you don't use.  Thus, with the help of a hacked
version of fontenc, it should be possible to implement full ISO 2022
with minimal cost.

I've produced a sample implementation of my plan; it is implemented as
a condom (a filter between a tty and a pty that intercepts ISO 2022
sequences).  I've implemented the full ``regular'' subset of ISO 2022,
including Emacs/MULE bug compatibility.  It is available in

  ftp://ftp.dcs.ed.ac.uk/pub/jec/programs/iso2022-0.1.tar.gz

Please DON'T REDISTRIBUTE THIS CODE, as it is a very early beta.

The following needs to be done:

 - conversion of program input (currently, input will only work for
   plain ASCII, and only if ASCII is selected in GL); this requires
   implementing in fontenc the ability to reverse a mapping (I think
   that lazy trees are the right data structure for that);

 - customisability of the ISO 2022 -> fontenc mapping through a plain
   text file (easy but tedious);

 - fixing the pty support, which is flaky and non-portable (ha!);

 - locale-dependent setting of the initial ISO 2022 state (this,
   again, should be user-configurable and extensible);

 - resynchronisation after a broken multibyte sequence (easy);

 - support for national ISO 646 variants and DEC technical (easy);

 - partial support for ISO 2022 ``other'' character sets (perhaps tricky).

I welcome any comments.  In particular, I would be interested to know
whether people prefer hacking at XTerm or a condom implementation (I
think I prefer the latter).

Regards,

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

Reply via email to