* 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)
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);