diff options
| author | Po Lu | 2024-06-15 10:04:07 +0800 |
|---|---|---|
| committer | Po Lu | 2024-06-15 10:04:07 +0800 |
| commit | 25452986cbcf3db02cf0b5b624a03bc146b5d80c (patch) | |
| tree | ad54f452820c8b8c88c60c838a339066a914545a /src | |
| parent | 1079d333ab7cb24b81e7ebc4087d2a11baa0097e (diff) | |
| download | emacs-25452986cbcf3db02cf0b5b624a03bc146b5d80c.tar.gz emacs-25452986cbcf3db02cf0b5b624a03bc146b5d80c.zip | |
Send proper substitution character to Android IMEs
* src/androidterm.c (android_text_to_string): Substitute
REPLACEMENT CHARACTER for NULL in converting characters not
representable without surrogate pairs to UTF-16.
Diffstat (limited to 'src')
| -rw-r--r-- | src/androidterm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/androidterm.c b/src/androidterm.c index 6ae9a676f3c..730c832bb5b 100644 --- a/src/androidterm.c +++ b/src/androidterm.c | |||
| @@ -5230,11 +5230,11 @@ android_text_to_string (JNIEnv *env, char *buffer, ptrdiff_t n, | |||
| 5230 | surrogate pairs. | 5230 | surrogate pairs. |
| 5231 | 5231 | ||
| 5232 | The hack used by Emacs is to simply replace each multibyte | 5232 | The hack used by Emacs is to simply replace each multibyte |
| 5233 | character that doesn't fit in a jchar with the NULL | 5233 | character that doesn't fit in a jchar with the Unicode |
| 5234 | character. */ | 5234 | replacement character. */ |
| 5235 | 5235 | ||
| 5236 | if (encoded >= 65536) | 5236 | if (encoded >= 65536) |
| 5237 | encoded = 0; | 5237 | encoded = 0xfffd; |
| 5238 | 5238 | ||
| 5239 | utf16[index++] = encoded; | 5239 | utf16[index++] = encoded; |
| 5240 | buffer += BYTES_BY_CHAR_HEAD (*buffer); | 5240 | buffer += BYTES_BY_CHAR_HEAD (*buffer); |