changeset 28897:f8602df501c6

(encode-coding-char): An ASCII character is always encodable.
author Kenichi Handa <handa@m17n.org>
date Sat, 13 May 2000 00:34:05 +0000
parents 0c70e1541a95
children a17b5669e2df
files lisp/international/mule-cmds.el
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/mule-cmds.el	Sat May 13 00:28:57 2000 +0000
+++ b/lisp/international/mule-cmds.el	Sat May 13 00:34:05 2000 +0000
@@ -1824,7 +1824,7 @@
   "Return a pretty description of STR that is encoded by CODING-SYSTEM."
   (setq str (string-as-unibyte str))
   (mapconcat
-   (if (eq (coding-system-type coding-system) 2)
+   (if (and coding-system (eq (coding-system-type coding-system) 2))
        ;; Try to get a pretty description for ISO 2022 escape sequences.
        (function (lambda (x) (or (cdr (assq x iso-2022-control-alist))
 				 (format "%02X" x))))
@@ -1838,9 +1838,11 @@
 	(str2 (make-string 2 char))
 	(safe-charsets (and coding-system
 			    (coding-system-get coding-system 'safe-charsets)))
+	(charset (char-charset char))
 	enc1 enc2 i1 i2)
     (when (or (eq safe-charsets t)
-	      (memq (char-charset char) safe-charsets))
+	      (eq charset 'ascii)
+	      (memq charset safe-charsets))
       ;; We must find the encoded string of CHAR.  But, just encoding
       ;; CHAR will put extra control sequences (usually to designate
       ;; ASCII charaset) at the tail if type of CODING is ISO 2022.