all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: decode-char & utf-8-fragment-on-decoding
@ 2002-09-05 17:39 Thomas Morgan
  2002-09-05 22:50 ` Dave Love
  0 siblings, 1 reply; 13+ messages in thread
From: Thomas Morgan @ 2002-09-05 17:39 UTC (permalink / raw)
  Cc: handa, bug-gnu-emacs

I wrote:

   I understand now that utf-8-fragment-on-decoding has no direct effect
   on decoding, but it is still not clear to me what indirect effect it is
   supposed to have when it is set through Custom.  Right now it applies
   to CCL programs, but not to decode-char.  Is that correct?

   If so, perhaps that should be documented.

When I think about it more carefully, I see that decode-char's
doc string is unambiguous when it says "the result is translated
through the char table `utf-8-translation-table-for-decode'".

For the sake of careless readers like me, could something like this
be added after that sentence?

  (Note that this char table is independent of the translation table
  of the same name which CCL programs use, and it is not affected by
  the user's setting of utf-8-fragment-on-decoding.)

^ permalink raw reply	[flat|nested] 13+ messages in thread
* decode-char & utf-8-fragment-on-decoding
@ 2002-09-04  5:56 Thomas Morgan
  2002-09-04  8:18 ` Kenichi Handa
  0 siblings, 1 reply; 13+ messages in thread
From: Thomas Morgan @ 2002-09-04  5:56 UTC (permalink / raw)


decode-char does not honor utf-8-fragment-on-decoding.

I tried this code in
GNU Emacs 21.3.50.2 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2002-09-03 on cricket
run with options -q and --no-site-file.

  (let ((utf-8-fragment-on-decoding nil)
        (c ?Γ))
    (= c (decode-char 'ucs (encode-char c 'ucs))))

encode-char returns 915, decode-char returns 2883, and the entire sexp
evalutes nil.  The Unicode code point is translated into greek-iso8859-7
by decode-char even though utf-8-fragment-on-decoding is not enabled.

Is this a bug?  The following change makes decode-char act as I expected.

*** /src/emacs/lisp/international/mule.el.~1.159.~	Sat Aug 24 03:46:25 2002
--- /src/emacs/lisp/international/mule.el	Wed Sep  4 01:30:54 2002
***************
*** 331,337 ****
  	       (setq code-point (- code-point #xe000))
  	       (make-char 'mule-unicode-e000-ffff
  			  (+ (/ code-point 96) 32) (+ (% code-point 96) 32))))))
!       (if (and c (aref utf-8-translation-table-for-decode c))
  	  (aref utf-8-translation-table-for-decode c)
  	c)))))
  
--- 331,339 ----
  	       (setq code-point (- code-point #xe000))
  	       (make-char 'mule-unicode-e000-ffff
  			  (+ (/ code-point 96) 32) (+ (% code-point 96) 32))))))
!       (if (and c
! 	       utf-8-fragment-on-decoding
! 	       (aref utf-8-translation-table-for-decode c))
  	  (aref utf-8-translation-table-for-decode c)
  	c)))))
  

Diff finished at Wed Sep  4 01:31:04

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

end of thread, other threads:[~2002-09-09 22:35 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-05 17:39 decode-char & utf-8-fragment-on-decoding Thomas Morgan
2002-09-05 22:50 ` Dave Love
  -- strict thread matches above, loose matches on Subject: below --
2002-09-04  5:56 Thomas Morgan
2002-09-04  8:18 ` Kenichi Handa
2002-09-04 23:34   ` Dave Love
2002-09-05  1:25     ` Kenichi Handa
2002-09-05 22:45       ` Dave Love
2002-09-05  5:23     ` Thomas Morgan
2002-09-05 22:47       ` Dave Love
2002-09-06  1:13         ` Thomas Morgan
2002-09-07 23:14           ` Dave Love
2002-09-08  1:07             ` Thomas Morgan
2002-09-09 22:35               ` Dave Love

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.