NAME

App::MathImage::Encode::X11 -- character encodings for X11

SYNOPSIS

use Encode;
use App::MathImage::Encode::X11;
my $chars = Encode::decode ('x11-compound-text', $bytes);

DESCRIPTION

This module encodes and decodes X11 ICCCM "compound text" strings,

x11-compound-text     COMPOUND_TEXT bytes

Compound text is ISO-2022 escape sequence runs of various basic encodings, including the ISO-8859 series, JIS, KSC, and GB.

The plain "x11-compound-text" name tries to encode in a sensible and compatible way. Perhaps in the future there'll be some options variations for which charsets to prefer in the encode.

The decode tries to recognise anything. Perhaps it just go to a full iso-2022, if/when that might exist, but for now it's done explicitly.

One of the motivations for compound text is that segments of the various charsets can be handled separately, for instance finding a font with the encoding and sending the bytes to the server to draw. Decoding to Perl wide chars doesn't suit that sort of thing.

XFree86 UTF-8

The UTF-8 escape from XFree86 and adopted as a variable encoding is recognised in the decode and used in the encode. For encode it's only used for characters not encodable by the basic ICCCM charsets. Preferring the original charsets should help inter-operation with older clients. Keeping the utf-8 to just otherwise unencodable parts might let as much as possible be understood by an older client.

Emacs

Emacs generates some "private encoding" escapes sequences. Not sure which of them are standard or semi-standard, so no promises whether they'll work. The intention would be to recognise semi-standard ones on decode at least.

SEE ALSO

Encode

HOME PAGE

http://user42.tuxfamily.org/math-image/index.html

LICENSE

Copyright 2011 Kevin Ryde

Math-Image is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

Math-Image is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Math-Image. If not, see http://www.gnu.org/licenses/.