This module encodes and decodes X11 ICCCM "compound text" strings.
x11-compound-text
Compound text is found in window properties of type "COMPOUND_TEXT". It's not usual to use it outside
that context. Compound text consists of ISO-2022 style escape sequences switching among various basic
charsets, including the ISO-8859 series, JIS, KSC, and GB.
The plain name "x11-compound-text" tries to encode in a sensible and compatible way. Perhaps in the
future there'll be some options or variations for which charsets to use. For now encoding prefers the
original ICCCM charsets latin-N, JIS, KSC and GB for the benefit of older X clients, then the newer utf-8
encoding when necessary.
The decode is meant to recognise anything, but may be a bit limited yet. Perhaps it could be just a full
ISO-2022 decode, if/when that might exist, but for now it's done explicitly and might potentially cope
with X11 specifics.
Decoding cns11643 segments requires the "Encode::HanExtra" module. Such segments are not normally
generated by the Xlib conversions (as of X.org libX11 1.4.0). Have HanExtra available if you think you
might encounter them.
Emacs has some "private encoding" sequences for big5. They're not supported currently.
When working with compound text you might in fact not want to convert it to Perl wide chars. If drawing
with the core X requests then split it into segments of the various charsets and find a font for each
encoding. Some oopery could no doubt represent such a breakdown and have things like concatenate or
compare. That would work almost directly with the bytes without converting.