From: Mattias Engdegård Date: Thu, 9 Apr 2020 09:29:51 +0000 (+0200) Subject: chinese-hz is not ASCII compatible (bug#40407) X-Git-Tag: emacs-28.0.90~7623 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=95dd8de1df19a8529efb66257ac78789be62ca37;p=emacs.git chinese-hz is not ASCII compatible (bug#40407) * lisp/language/chinese.el: Disable :ascii-compatible-p for chinese-hz. * test/lisp/international/mule-tests.el (mule-hz): New test. --- diff --git a/lisp/language/chinese.el b/lisp/language/chinese.el index bc6969c1398..4389db961d8 100644 --- a/lisp/language/chinese.el +++ b/lisp/language/chinese.el @@ -103,6 +103,11 @@ (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) diff --git a/test/lisp/international/mule-tests.el b/test/lisp/international/mule-tests.el index bb96943888f..5f8e653d7c2 100644 --- a/test/lisp/international/mule-tests.el +++ b/test/lisp/international/mule-tests.el @@ -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.