[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/international/utf-16.el
From: |
Kenichi Handa |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/international/utf-16.el |
Date: |
Sun, 30 Mar 2003 20:48:24 -0500 |
Index: emacs/lisp/international/utf-16.el
diff -c emacs/lisp/international/utf-16.el:1.7
emacs/lisp/international/utf-16.el:1.8
*** emacs/lisp/international/utf-16.el:1.7 Tue Feb 4 08:09:38 2003
--- emacs/lisp/international/utf-16.el Sun Mar 30 20:48:23 2003
***************
*** 68,75 ****
;; Needed in macro expansion, so can't be let-bound. Zapped after use.
(eval-and-compile
(defconst utf-16-decode-ucs
! ;; We have the unicode in r1. Output is charset ID in r0, code point
! ;; in r1.
`((lookup-integer utf-subst-table-for-decode r1 r3)
(if r7 ; got a translation
((r0 = r1) (r1 = r3))
--- 68,76 ----
;; Needed in macro expansion, so can't be let-bound. Zapped after use.
(eval-and-compile
(defconst utf-16-decode-ucs
! ;; We have the unicode in r1. Output is charset ID in r0, code
! ;; point in r1. As r6 keeps endian information, the value should
! ;; not be changed.
`((lookup-integer utf-subst-table-for-decode r1 r3)
(if r7 ; got a translation
((r0 = r1) (r1 = r3))
***************
*** 114,128 ****
(define-ccl-program ccl-decode-mule-utf-16-le
`(2 ; 2 bytes -> 1 to 4 bytes
! ((read r0 r1) ; signature
! (loop
(read r3 r4)
(r1 = (r4 <8 r3))
,utf-16-decode-ucs
(translate-character utf-translation-table-for-decode r0 r1)
(write-multibyte-character r0 r1)
(repeat))))
! "Decode little endian UTF-16 (ignoring signature bytes).
Basic decoding is done into the charsets ascii, latin-iso8859-1 and
mule-unicode-*. Un-representable Unicode characters are decoded as
U+fffd. The result is run through the translation-table named
--- 115,128 ----
(define-ccl-program ccl-decode-mule-utf-16-le
`(2 ; 2 bytes -> 1 to 4 bytes
! ((loop
(read r3 r4)
(r1 = (r4 <8 r3))
,utf-16-decode-ucs
(translate-character utf-translation-table-for-decode r0 r1)
(write-multibyte-character r0 r1)
(repeat))))
! "Decode UTF-16LE (little endian without signature bytes).
Basic decoding is done into the charsets ascii, latin-iso8859-1 and
mule-unicode-*. Un-representable Unicode characters are decoded as
U+fffd. The result is run through the translation-table named
***************
*** 130,144 ****
(define-ccl-program ccl-decode-mule-utf-16-be
`(2 ; 2 bytes -> 1 to 4 bytes
! ((read r0 r1) ; signature
! (loop
(read r3 r4)
(r1 = (r3 <8 r4))
,utf-16-decode-ucs
(translate-character utf-translation-table-for-decode r0 r1)
(write-multibyte-character r0 r1)
(repeat))))
! "Decode big endian UTF-16 (ignoring signature bytes).
Basic decoding is done into the charsets ascii, latin-iso8859-1 and
mule-unicode-*. Un-representable Unicode characters are
decoded as U+fffd. The result is run through the translation-table of
--- 130,143 ----
(define-ccl-program ccl-decode-mule-utf-16-be
`(2 ; 2 bytes -> 1 to 4 bytes
! ((loop
(read r3 r4)
(r1 = (r3 <8 r4))
,utf-16-decode-ucs
(translate-character utf-translation-table-for-decode r0 r1)
(write-multibyte-character r0 r1)
(repeat))))
! "Decode UTF-16BE (big endian without signature bytes).
Basic decoding is done into the charsets ascii, latin-iso8859-1 and
mule-unicode-*. Un-representable Unicode characters are
decoded as U+fffd. The result is run through the translation-table of
***************
*** 173,181 ****
(define-ccl-program ccl-encode-mule-utf-16-le
`(1
! ((write #xff)
! (write #xfe)
! (loop
(read-multibyte-character r0 r1)
(lookup-character utf-subst-table-for-encode r0 r1)
(if (r7 == 0)
--- 172,178 ----
(define-ccl-program ccl-encode-mule-utf-16-le
`(1
! ((loop
(read-multibyte-character r0 r1)
(lookup-character utf-subst-table-for-encode r0 r1)
(if (r7 == 0)
***************
*** 184,190 ****
(write (r0 & 255))
(write (r0 >> 8))
(repeat))))
! "Encode to little endian UTF-16 with signature.
Characters from the charsets ascii, eight-bit-control,
eight-bit-graphic, latin-iso8859-1 and mule-unicode-* are encoded
after translation through the translation-table of name
--- 181,187 ----
(write (r0 & 255))
(write (r0 >> 8))
(repeat))))
! "Encode to UTF-16LE (little endian without signature).
Characters from the charsets ascii, eight-bit-control,
eight-bit-graphic, latin-iso8859-1 and mule-unicode-* are encoded
after translation through the translation-table of name
***************
*** 193,201 ****
(define-ccl-program ccl-encode-mule-utf-16-be
`(1
! ((write #xfe)
! (write #xff)
! (loop
(read-multibyte-character r0 r1)
(lookup-character utf-subst-table-for-encode r0 r1)
(if (r7 == 0)
--- 190,196 ----
(define-ccl-program ccl-encode-mule-utf-16-be
`(1
! ((loop
(read-multibyte-character r0 r1)
(lookup-character utf-subst-table-for-encode r0 r1)
(if (r7 == 0)
***************
*** 204,210 ****
(write (r0 >> 8))
(write (r0 & 255))
(repeat))))
! "Encode to big endian UTF-16 with signature.
Characters from the charsets ascii, eight-bit-control,
eight-bit-graphic, latin-iso8859-1 and mule-unicode-* are encoded
after translation through the translation-table named
--- 199,205 ----
(write (r0 >> 8))
(write (r0 & 255))
(repeat))))
! "Encode to UTF-16BE (big endian without signature).
Characters from the charsets ascii, eight-bit-control,
eight-bit-graphic, latin-iso8859-1 and mule-unicode-* are encoded
after translation through the translation-table named
***************
*** 214,221 ****
(makunbound 'utf-16-decode-to-ucs)
(let ((doc "
-
- Assumes and ignores the leading two-byte signature.
It supports Unicode characters of these ranges:
U+0000..U+33FF, U+E000..U+FFFF.
--- 209,214 ----
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/international/utf-16.el,
Kenichi Handa <=