emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/international/mule.el


From: Dave Love
Subject: [Emacs-diffs] Changes to emacs/lisp/international/mule.el
Date: Wed, 17 Jul 2002 15:20:02 -0400

Index: emacs/lisp/international/mule.el
diff -c emacs/lisp/international/mule.el:1.151 
emacs/lisp/international/mule.el:1.152
*** emacs/lisp/international/mule.el:1.151      Wed Jul 17 15:06:52 2002
--- emacs/lisp/international/mule.el    Wed Jul 17 15:20:01 2002
***************
*** 307,340 ****
    "Return character specified by coded character set CCS and CODE-POINT in it.
  Return nil if such a character is not supported.
  Currently the only supported coded character set is `ucs' (ISO/IEC
! 10646: Universal Multi-Octet Coded Character Set).
  
  Optional argument RESTRICTION specifies a way to map the pair of CCS
  and CODE-POINT to a character.   Currently not supported and just ignored."
!   (cond ((eq ccs 'ucs)
!        (cond ((< code-point 160)
!               code-point)
!              ((< code-point 256)
!               (make-char 'latin-iso8859-1 code-point))
!              ((< code-point #x2500)
!               (setq code-point (- code-point #x0100))
!               (make-char 'mule-unicode-0100-24ff
!                          (+ (/ code-point 96) 32) (+ (% code-point 96) 32)))
!              ((< code-point #x3400)
!               (setq code-point (- code-point #x2500))
!               (make-char 'mule-unicode-2500-33ff
!                          (+ (/ code-point 96) 32) (+ (% code-point 96) 32)))
!              ((and (>= code-point #xe000) (< code-point #x10000))
!               (setq code-point (- code-point #xe000))
!               (make-char 'mule-unicode-e000-ffff
!                          (+ (/ code-point 96) 32) (+ (% code-point 96) 32)))
!              ))))
  
  (defun encode-char (char ccs &optional restriction)
    "Return code-point in coded character set CCS that corresponds to CHAR.
  Return nil if CHAR is not included in CCS.
  Currently the only supported coded character set is `ucs' (ISO/IEC
! 10646: Universal Multi-Octet Coded Character Set).
  
  CHAR should be in one of these charsets:
    ascii, latin-iso8859-1, mule-unicode-0100-24ff, mule-unicode-2500-33ff,
--- 307,346 ----
    "Return character specified by coded character set CCS and CODE-POINT in it.
  Return nil if such a character is not supported.
  Currently the only supported coded character set is `ucs' (ISO/IEC
! 10646: Universal Multi-Octet Coded Character Set), and the result is
! translated through the char table `utf-8-translation-table-for-decode'.
  
  Optional argument RESTRICTION specifies a way to map the pair of CCS
  and CODE-POINT to a character.   Currently not supported and just ignored."
!   (cond
!    ((eq ccs 'ucs)
!     (let ((c (cond
!             ((< code-point 160)
!              code-point)
!             ((< code-point 256)
!              (make-char 'latin-iso8859-1 code-point))
!             ((< code-point #x2500)
!              (setq code-point (- code-point #x0100))
!              (make-char 'mule-unicode-0100-24ff
!                         (+ (/ code-point 96) 32) (+ (% code-point 96) 32)))
!             ((< code-point #x3400)
!              (setq code-point (- code-point #x2500))
!              (make-char 'mule-unicode-2500-33ff
!                         (+ (/ code-point 96) 32) (+ (% code-point 96) 32)))
!             ((and (>= code-point #xe000) (< code-point #x10000))
!              (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)))))
  
  (defun encode-char (char ccs &optional restriction)
    "Return code-point in coded character set CCS that corresponds to CHAR.
  Return nil if CHAR is not included in CCS.
  Currently the only supported coded character set is `ucs' (ISO/IEC
! 10646: Universal Multi-Octet Coded Character Set), and CHAR is first
! translated through the char-table `ucs-mule-to-mule-unicode'.
  
  CHAR should be in one of these charsets:
    ascii, latin-iso8859-1, mule-unicode-0100-24ff, mule-unicode-2500-33ff,
***************
*** 344,351 ****
  Optional argument RESTRICTION specifies a way to map CHAR to a
  code-point in CCS.  Currently not supported and just ignored."
    (let* ((split (split-char char))
!        (charset (car split)))
      (cond ((eq ccs 'ucs)
           (cond ((eq charset 'ascii)
                  char)
                 ((eq charset 'latin-iso8859-1)
--- 350,362 ----
  Optional argument RESTRICTION specifies a way to map CHAR to a
  code-point in CCS.  Currently not supported and just ignored."
    (let* ((split (split-char char))
!        (charset (car split))
!        trans)
      (cond ((eq ccs 'ucs)
+          (setq trans (aref ucs-mule-to-mule-unicode char))
+          (if trans
+              (setq split (split-char trans)
+                    charset (car split)))
           (cond ((eq charset 'ascii)
                  char)
                 ((eq charset 'latin-iso8859-1)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]