]> git.eshelyaron.com Git - emacs.git/commitdiff
chinese-hz is not ASCII compatible (bug#40407)
authorMattias Engdegård <mattiase@acm.org>
Thu, 9 Apr 2020 09:29:51 +0000 (11:29 +0200)
committerMattias Engdegård <mattiase@acm.org>
Thu, 9 Apr 2020 10:06:39 +0000 (12:06 +0200)
* lisp/language/chinese.el: Disable :ascii-compatible-p for chinese-hz.
* test/lisp/international/mule-tests.el (mule-hz): New test.

lisp/language/chinese.el
test/lisp/international/mule-tests.el

index bc6969c1398cc6c5cb766eaf008d31b67e20af13..4389db961d840517513c1fe196b89eb9d67be965 100644 (file)
 (define-coding-system-alias 'hz-gb-2312 'chinese-hz)
 (define-coding-system-alias 'hz 'chinese-hz)
 
+;; FIXME: 'define-coding-system' automatically sets :ascii-compatible-p,
+;; to any encoding whose :coding-type is 'utf-8', but UTF-7 is not ASCII
+;; compatible, so we override that here (bug#40407).
+(coding-system-put 'chinese-hz :ascii-compatible-p nil)
+
 (set-language-info-alist
  "Chinese-GB" '((charset chinese-gb2312 chinese-sisheng)
                (iso639-language . zh)
index bb96943888f5f6c611793415ad0a9c616dadc6cf..5f8e653d7c2f148ee6c5c415c8f6bdcfaa6b08c6 100644 (file)
@@ -65,6 +65,9 @@
   (should (equal (encode-coding-string "あ" 'utf-7-imap) "&MEI-"))
   (should (equal (decode-coding-string "&MEI-" 'utf-7-imap) "あ")))
 
+(ert-deftest mule-hz ()
+  ;; The chinese-hz encoding is not ASCII compatible.
+  (should-not (coding-system-get 'chinese-hz :ascii-compatible-p)))
 
 ;; Stop "Local Variables" above causing confusion when visiting this file.
 \f