From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Ehud Karni" Newsgroups: gmane.emacs.devel Subject: Re: Usage of standard-display-table in MSDOS Date: Sun, 29 Aug 2010 16:06:42 +0300 Organization: Mivtach-Simon Insurance agencies Message-ID: <201008291306.o7TD6gZ5007449@beta.mvs.co.il> References: <83aao8mjzx.fsf@gnu.org> <837hjcm9cw.fsf@gnu.org> <201008291016.o7TAG22t007365@beta.mvs.co.il> <201008291149.o7TBn3bO010199@beta.mvs.co.il> Reply-To: ehud@unix.mvs.co.il NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1283087219 8962 80.91.229.12 (29 Aug 2010 13:06:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 29 Aug 2010 13:06:59 +0000 (UTC) Cc: emacs-devel@gnu.org, handa@m17n.org To: eliz@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 29 15:06:57 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ophb7-00079t-F5 for ged-emacs-devel@m.gmane.org; Sun, 29 Aug 2010 15:06:57 +0200 Original-Received: from localhost ([127.0.0.1]:44579 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ophb6-0002Zd-SN for ged-emacs-devel@m.gmane.org; Sun, 29 Aug 2010 09:06:56 -0400 Original-Received: from [140.186.70.92] (port=56048 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ophb0-0002ZY-PG for emacs-devel@gnu.org; Sun, 29 Aug 2010 09:06:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ophaz-0002sl-50 for emacs-devel@gnu.org; Sun, 29 Aug 2010 09:06:50 -0400 Original-Received: from [193.16.147.12] (port=41494 helo=unix.mvs.co.il) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ophay-0002sX-J8; Sun, 29 Aug 2010 09:06:49 -0400 Original-Received: from beta.mvs.co.il (beta [10.253.0.3]) by unix.mvs.co.il (8.13.8/8.13.7) with ESMTP id o7TD6iZo017344; Sun, 29 Aug 2010 16:06:44 +0300 Original-Received: from beta.mvs.co.il (localhost [127.0.0.1]) by beta.mvs.co.il (8.14.1/8.14.1) with ESMTP id o7TD6hIj007454; Sun, 29 Aug 2010 16:06:43 +0300 Original-Received: (from root@localhost) by beta.mvs.co.il (8.14.1/8.14.1/Submit) id o7TD6gZ5007449; Sun, 29 Aug 2010 16:06:42 +0300 In-reply-to: <201008291149.o7TBn3bO010199@beta.mvs.co.il> (message from Ehud Karni on Sun, 29 Aug 2010 14:49:03 +0300) X-Mailer: Emacs 21.3.1 rmail (send-msg 1.109) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:129395 Archived-At: 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" > > > > > > > ;; 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 Better Safe Than Sorry