unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* X11 Compound Text vs ISO 2022
@ 2010-07-06 16:21 James Cloos
  2010-07-06 20:18 ` David De La Harpe Golden
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: James Cloos @ 2010-07-06 16:21 UTC (permalink / raw)
  To: emacs-devel

While testing my recently applied patch, I've discovered that Emacs will
product ISO-2022 output for COMPOUND_TEXT which other libs and apps --
notably including libX11 -- cannot decode.

As an example, (encode-coding-string "•" 'compound-text) ; U+2022 BULLET
produces "^[$(O#@^[(B".  '$(O' is ISO-IR 228¹, JIS X 2013:2000.  But
libX11 only knows about the $( charsets:  0, 1, A-D and G-M.

A number of characters are output in '^[$-1'; such as:

(encode-coding-string "ℜ" 'compound-text) ; U+211C BLACK-LETTER CAPITAL R
"^[$-1\365\334^[-A"
(encode-coding-string "ʻ" 'compound-text) ; U+02BB MODIFIER LETTER TURNED COMMA
"^[$-1\244\333^[-A"

That is encoded in mule-unicode-0100-24ff, essentially unknown outside
Emacs.

Other libs/apps prefer to use utf-8³ in compound_text for such chars.

I understand *why* this happens, given that Emacs used to use 2022
internally, but it confuses other X11 apps.

I am not fully fluent in Emacs' internal charset conversion routines;
is there an easy way to tell it to limit which 2022 charsets it will
use when converting a string into a 2022 encoding?  A better way?

I will be adding at least some of the charsets to libX11, provided I can
find the relevant mappings with X11-compatable licensing, but that will
not help current installations, nor those who, like Emacs, rolled their
own compund_text decoders.

-JimC

P.S.  The libX11 src, in libX11/src/xlibi18n/lcCT.c, is the best
      resource to know which 2022 charsets libX11 supports.

1] http://www.itscj.ipsj.or.jp/ISO-IR/228.pdf
2] http://www.itscj.ipsj.or.jp/ISO-IR/143.pdf
3] http://www.itscj.ipsj.or.jp/ISO-IR/196.pdf

-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6



^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2010-08-09  1:49 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-06 16:21 X11 Compound Text vs ISO 2022 James Cloos
2010-07-06 20:18 ` David De La Harpe Golden
2010-07-06 22:30   ` James Cloos
2010-07-07  0:36     ` Stephen J. Turnbull
2010-07-07  5:19       ` James Cloos
2010-07-07 19:51         ` James Cloos
2010-07-08  0:24           ` David De La Harpe Golden
2010-07-14 21:07             ` James Cloos
2010-07-06 23:38 ` David De La Harpe Golden
2010-07-07  1:15   ` David De La Harpe Golden
2010-07-07  4:55   ` James Cloos
2010-07-29 12:36 ` Kenichi Handa
2010-07-29 15:51   ` James Cloos
2010-07-30  1:27     ` Kenichi Handa
2010-07-30 18:46       ` James Cloos
2010-08-01  9:35         ` Stephen J. Turnbull
2010-08-01 11:06           ` James Cloos
2010-08-02  8:14             ` Stephen J. Turnbull
2010-08-06 12:50             ` Kenichi Handa
2010-08-08  9:47               ` James Cloos
2010-08-09  1:49                 ` Kenichi Handa

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).