/[emacs]/emacs/lisp/international/utf-8.el
ViewVC logotype

Diff of /emacs/lisp/international/utf-8.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.13.2.6 by miles, Tue Jul 6 10:14:26 2004 UTC revision 1.13.2.7 by miles, Sat Sep 4 09:19:26 2004 UTC
# Line 273  The value nil means that the tables are Line 273  The value nil means that the tables are
273        (utf-translate-cjk-load-tables))        (utf-translate-cjk-load-tables))
274    (gethash code-point    (gethash code-point
275             (get 'utf-subst-table-for-decode 'translation-hash-table)))             (get 'utf-subst-table-for-decode 'translation-hash-table)))
276      
277    
278  (defun utf-lookup-subst-table-for-encode (char)  (defun utf-lookup-subst-table-for-encode (char)
279    (if (and utf-translate-cjk-mode    (if (and utf-translate-cjk-mode
# Line 282  The value nil means that the tables are Line 282  The value nil means that the tables are
282        (utf-translate-cjk-load-tables))        (utf-translate-cjk-load-tables))
283    (gethash char    (gethash char
284             (get 'utf-subst-table-for-encode 'translation-hash-table)))             (get 'utf-subst-table-for-encode 'translation-hash-table)))
285      
286  (define-minor-mode utf-translate-cjk-mode  (define-minor-mode utf-translate-cjk-mode
287    "Whether the UTF based coding systems should decode/encode CJK characters.    "Toggle whether UTF based coding systems de/encode CJK characters.
288    If ARG is an integer, enable if ARG is positive and disable if
289    zero or negative.  This is a minor mode.
290  Enabling this allows the coding systems mule-utf-8,  Enabling this allows the coding systems mule-utf-8,
291  mule-utf-16le and mule-utf-16be to encode characters in the charsets  mule-utf-16le and mule-utf-16be to encode characters in the charsets
292  `korean-ksc5601', `chinese-gb2312', `chinese-big5-1',  `korean-ksc5601', `chinese-gb2312', `chinese-big5-1',
# Line 296  according to the language environment in Line 298  according to the language environment in
298  turned on: ksc5601 for Korean, gb2312 for Chinese-GB, big5 for  turned on: ksc5601 for Korean, gb2312 for Chinese-GB, big5 for
299  Chinese-Big5 and jisx for other environments.  Chinese-Big5 and jisx for other environments.
300    
301  This option is on by default.  If you are not interested in CJK  This mode is on by default.  If you are not interested in CJK
302  characters and want to avoid some overhead on encoding/decoding  characters and want to avoid some overhead on encoding/decoding
303  by the above coding systems, you can customize this option to nil."  by the above coding systems, you can customize the user option
304    `utf-translate-cjk-mode' to nil."
305    :init-value t    :init-value t
306    :version "21.4"    :version "21.4"
307    :type 'boolean    :type 'boolean
# Line 605  eight-bit-control and eight-bit-graphic Line 608  eight-bit-control and eight-bit-graphic
608    ;; UTF-8 decoder generates an UTF-8 sequence represented by a    ;; UTF-8 decoder generates an UTF-8 sequence represented by a
609    ;; sequence eight-bit-control/graphic chars for an untranslatable    ;; sequence eight-bit-control/graphic chars for an untranslatable
610    ;; character and an invalid byte.    ;; character and an invalid byte.
611    ;;    ;;
612    ;; This CCL parses that sequence (the first byte is already in r1),    ;; This CCL parses that sequence (the first byte is already in r1),
613    ;; writes out the original bytes of that sequence, and sets r5 to    ;; writes out the original bytes of that sequence, and sets r5 to
614    ;; -1.    ;; -1.
# Line 624  eight-bit-control and eight-bit-graphic Line 627  eight-bit-control and eight-bit-graphic
627       (read-multibyte-character r5 r6)       (read-multibyte-character r5 r6)
628       (r0 = (r5 != ,(charset-id 'eight-bit-control)))       (r0 = (r5 != ,(charset-id 'eight-bit-control)))
629       (if ((r5 != ,(charset-id 'eight-bit-graphic)) & r0)       (if ((r5 != ,(charset-id 'eight-bit-graphic)) & r0)
630           ((write r1)                    ; invalid UTF-8           ((write r1)                    ; invalid UTF-8
631            (r1 = -1)            (r1 = -1)
632            (end)))            (end)))
633    
# Line 641  eight-bit-control and eight-bit-graphic Line 644  eight-bit-control and eight-bit-graphic
644       (r1 = -1)       (r1 = -1)
645       ;; Read the 3rd byte.       ;; Read the 3rd byte.
646       (read-multibyte-character r5 r6)       (read-multibyte-character r5 r6)
647       (r0 = (r5 != ,(charset-id 'eight-bit-control)))                 (r0 = (r5 != ,(charset-id 'eight-bit-control)))
648       (if ((r5 != ,(charset-id 'eight-bit-graphic)) & r0)       (if ((r5 != ,(charset-id 'eight-bit-graphic)) & r0)
649           (end))                         ; invalid UTF-8           (end))                         ; invalid UTF-8
650       (write r6)       (write r6)
# Line 651  eight-bit-control and eight-bit-graphic Line 654  eight-bit-control and eight-bit-graphic
654            (end)))            (end)))
655       ;; Read the 4th byte.       ;; Read the 4th byte.
656       (read-multibyte-character r5 r6)       (read-multibyte-character r5 r6)
657       (r0 = (r5 != ,(charset-id 'eight-bit-control)))                 (r0 = (r5 != ,(charset-id 'eight-bit-control)))
658       (if ((r5 != ,(charset-id 'eight-bit-graphic)) & r0)       (if ((r5 != ,(charset-id 'eight-bit-graphic)) & r0)
659           (end))                 ; invalid UTF-8           (end))                 ; invalid UTF-8
660       ;; 4-byte sequence for an untranslated character.       ;; 4-byte sequence for an untranslated character.

Legend:
Removed from v.1.13.2.6  
changed lines
  Added in v.1.13.2.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26