diff options
| author | Stefan Monnier | 2019-05-28 19:33:20 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2019-05-28 19:33:20 -0400 |
| commit | 96a0d4fe41905e84a109f25848c1fb7c561a737c (patch) | |
| tree | 4aab966f1e6b3668cd3c1e7b473e0b5a679c83e8 /test | |
| parent | 997ac9f829059bf37c81fd586910c834394951e6 (diff) | |
| download | emacs-96a0d4fe41905e84a109f25848c1fb7c561a737c.tar.gz 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')
| -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 @@ | |||
| 36 | (find-auto-coding "" (buffer-size))) | 36 | (find-auto-coding "" (buffer-size))) |
| 37 | '(utf-8 . :coding))))) | 37 | '(utf-8 . :coding))))) |
| 38 | 38 | ||
| 39 | (ert-deftest mule-cmds-tests--encode-ebcdic () | ||
| 40 | (should (equal (encode-coding-char ?a 'ebcdic-int) "\201")) | ||
| 41 | (should (not (multibyte-string-p (encode-coding-char ?a 'utf-8))))) | ||
| 42 | |||
| 39 | ;; Stop "Local Variables" above causing confusion when visiting this file. | 43 | ;; Stop "Local Variables" above causing confusion when visiting this file. |
| 40 | 44 | ||
| 41 | 45 | ||