# HG changeset patch # User Kenichi Handa # Date 958178045 0 # Node ID f8602df501c67c407ea1ce0076eb82988e5a9998 # Parent 0c70e1541a9558876bac24a9c57f3ee182938716 (encode-coding-char): An ASCII character is always encodable. diff -r 0c70e1541a95 -r f8602df501c6 lisp/international/mule-cmds.el --- 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.