diff options
| author | Kenichi Handa | 2000-05-26 02:39:09 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2000-05-26 02:39:09 +0000 |
| commit | bd9531732967151a847562e98a99fa6e97250ce6 (patch) | |
| tree | 56134a3ca0af308d2a26f878a79bbc18c5a590da | |
| parent | ba9f8f95c4d839065b1255384b63b78d89d12ab8 (diff) | |
| download | emacs-bd9531732967151a847562e98a99fa6e97250ce6.tar.gz emacs-bd9531732967151a847562e98a99fa6e97250ce6.zip | |
(encode-coding-char): Make strings
multibyte before calling encode-coding-string.
| -rw-r--r-- | lisp/international/mule-cmds.el | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index ade85317582..016c2c4ecfb 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el | |||
| @@ -1835,8 +1835,8 @@ It can be retrieved with `(get-char-code-property CHAR PROPNAME)'." | |||
| 1835 | (defun encode-coding-char (char coding-system) | 1835 | (defun encode-coding-char (char coding-system) |
| 1836 | "Encode CHAR by CODING-SYSTEM and return the resulting string. | 1836 | "Encode CHAR by CODING-SYSTEM and return the resulting string. |
| 1837 | If CODING-SYSTEM can't safely encode CHAR, return nil." | 1837 | If CODING-SYSTEM can't safely encode CHAR, return nil." |
| 1838 | (let ((str1 (char-to-string char)) | 1838 | (let ((str1 (string-as-multibyte (char-to-string char))) |
| 1839 | (str2 (make-string 2 char)) | 1839 | (str2 (string-as-multibyte (make-string 2 char))) |
| 1840 | (safe-charsets (and coding-system | 1840 | (safe-charsets (and coding-system |
| 1841 | (coding-system-get coding-system 'safe-charsets))) | 1841 | (coding-system-get coding-system 'safe-charsets))) |
| 1842 | (charset (char-charset char)) | 1842 | (charset (char-charset char)) |
| @@ -1851,9 +1851,9 @@ If CODING-SYSTEM can't safely encode CHAR, return nil." | |||
| 1851 | ;; string and two-char string, then check how many bytes at the | 1851 | ;; string and two-char string, then check how many bytes at the |
| 1852 | ;; tail of both encoded strings are the same. | 1852 | ;; tail of both encoded strings are the same. |
| 1853 | 1853 | ||
| 1854 | (setq enc1 (string-as-unibyte (encode-coding-string str1 coding-system)) | 1854 | (setq enc1 (encode-coding-string str1 coding-system) |
| 1855 | i1 (length enc1) | 1855 | i1 (length enc1) |
| 1856 | enc2 (string-as-unibyte (encode-coding-string str2 coding-system)) | 1856 | enc2 (encode-coding-string str2 coding-system) |
| 1857 | i2 (length enc2)) | 1857 | i2 (length enc2)) |
| 1858 | (while (and (> i1 0) (= (aref enc1 (1- i1)) (aref enc2 (1- i2)))) | 1858 | (while (and (> i1 0) (= (aref enc1 (1- i1)) (aref enc2 (1- i2)))) |
| 1859 | (setq i1 (1- i1) i2 (1- i2))) | 1859 | (setq i1 (1- i1) i2 (1- i2))) |