diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2019-05-28 19:33:20 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2019-05-28 19:33:20 -0400 |
commit | 96a0d4fe41905e84a109f25848c1fb7c561a737c (patch) | |
tree | 4aab966f1e6b3668cd3c1e7b473e0b5a679c83e8 /test/lisp/international/mule-tests.el | |
parent | 997ac9f829059bf37c81fd586910c834394951e6 (diff) | |
download | emacs-96a0d4fe41905e84a109f25848c1fb7c561a737c.tar.gz emacs-96a0d4fe41905e84a109f25848c1fb7c561a737c.tar.bz2 emacs-96a0d4fe41905e84a109f25848c1fb7c561a737c.zip |
* lisp/international/mule-cmds.el (encode-coding-char): Fix ASCII case
Don't bother with string-as-multibyte since `string` already returns
multibyte when needed. Don't forget to encode when the string is
ASCII, e.g. for ebcdic case and to make sure we always return
a unibyte string.
* test/lisp/international/mule-tests.el (mule-cmds-tests--encode-ebcdic):
New test.
Diffstat (limited to 'test/lisp/international/mule-tests.el')
-rw-r--r-- | test/lisp/international/mule-tests.el | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/lisp/international/mule-tests.el b/test/lisp/international/mule-tests.el index 4c937caa142..678cbc29738 100644 --- a/test/lisp/international/mule-tests.el +++ b/test/lisp/international/mule-tests.el @@ -36,6 +36,10 @@ (find-auto-coding "" (buffer-size))) '(utf-8 . :coding))))) +(ert-deftest mule-cmds-tests--encode-ebcdic () + (should (equal (encode-coding-char ?a 'ebcdic-int) "\201")) + (should (not (multibyte-string-p (encode-coding-char ?a 'utf-8))))) + ;; Stop "Local Variables" above causing confusion when visiting this file. |