From: Po Lu Date: Sat, 15 Jun 2024 02:04:07 +0000 (+0800) Subject: Send proper substitution character to Android IMEs X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7ab2f4956049c9861510792c8b07c97703ed48bb;p=emacs.git 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. (cherry picked from commit 25452986cbcf3db02cf0b5b624a03bc146b5d80c) --- 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, surrogate pairs. The hack used by Emacs is to simply replace each multibyte - character that doesn't fit in a jchar with the NULL - character. */ + character that doesn't fit in a jchar with the Unicode + replacement character. */ if (encoded >= 65536) - encoded = 0; + encoded = 0xfffd; utf16[index++] = encoded; buffer += BYTES_BY_CHAR_HEAD (*buffer);