[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Usage of standard-display-table in MSDOS
From: |
Ehud Karni |
Subject: |
Re: Usage of standard-display-table in MSDOS |
Date: |
Sun, 29 Aug 2010 16:06:42 +0300 |
On Sun, 29 Aug 2010 14:49:03 Ehud Karni wrote:
>
> On Sun, 29 Aug 2010 07:21:26 Eli Zaretskii wrote:
> >
> > > From: "Ehud Karni" <address@hidden>
> > >
> > > > ;; For NBSP (U+00A0)
> > > > (aset standard-display-table #xA0
> > > > (vector (unibyte-char-to-multibyte #xA0)))
> > >
> > > The result in 21.3 is correct:
> > > Byte: E0 (224), Char: 0C60 (3168)
> > >
> > > But on 23.1 I get:
> > > Byte: E0 (224), Char: 3FFFE0 (4194272)
> > > i.e. "literal" #xE0.
> >
> > The last result is correct 0x3FFFE0 is the internal representation of
> > 0xE0 in Emacs 23. Emacs 23 and later extends the Unicode code space
> > with these characters (and some others).
> >
> > Why did you think it was incorrect?
>
> Because of my coding system (iso-8859, remember ?) the #xE0 should be
> displayed as Aleph, not some 8 bit byte E0.
>From another thread, I found Handa san suggestion to use `decode-char'.
So my my check function looks now like this:
(defun check-multibyte-code (byte)
(message "Byte: %02X (%d), M-Char: %04X (%d), D-Char: %04X (%d)"
byte byte
(unibyte-char-to-multibyte byte)
(unibyte-char-to-multibyte byte)
(decode-char 'iso-8859-8 byte)
(decode-char 'iso-8859-8 byte)))
It fails for Emacs-21.3 because `decode-char' returns nil.
For Emacs-23.1 the result is:
Byte: E0 (224), M-Char: 3FFFE0 (4194272), D-Char 05D0 (1488)
So I can use `decode-char' in 23.1 and `unibyte-char-to-multibyte'
in 21.3 for building a display table.
Can you give the reasons to the changes in these functions ?
I think it is a bad practice to keep the function names while
changing how they work. It breaks tested code.
Ehud.
--
Ehud Karni Tel: +972-3-7966-561 /"\
Mivtach - Simon Fax: +972-3-7976-561 \ / ASCII Ribbon Campaign
Insurance agencies (USA) voice mail and X Against HTML Mail
http://www.mvs.co.il FAX: 1-815-5509341 / \
GnuPG: 98EA398D <http://www.keyserver.net/> Better Safe Than Sorry
- Re: Usage of standard-display-table in MSDOS, (continued)
- Re: Usage of standard-display-table in MSDOS, Kenichi Handa, 2010/08/27
- Re: Usage of standard-display-table in MSDOS, Eli Zaretskii, 2010/08/27
- Re: Usage of standard-display-table in MSDOS, Kenichi Handa, 2010/08/28
- Re: Usage of standard-display-table in MSDOS, Eli Zaretskii, 2010/08/28
- Re: Usage of standard-display-table in MSDOS, Kenichi Handa, 2010/08/29
- Re: Usage of standard-display-table in MSDOS, Eli Zaretskii, 2010/08/29
- Re: Usage of standard-display-table in MSDOS, Kenichi Handa, 2010/08/31
- Re: Usage of standard-display-table in MSDOS, Ehud Karni, 2010/08/29
- Re: Usage of standard-display-table in MSDOS, Eli Zaretskii, 2010/08/29
- Re: Usage of standard-display-table in MSDOS, Ehud Karni, 2010/08/29
- Re: Usage of standard-display-table in MSDOS,
Ehud Karni <=
- Re: Usage of standard-display-table in MSDOS, Eli Zaretskii, 2010/08/29
- Re: Usage of standard-display-table in MSDOS, Eli Zaretskii, 2010/08/29