X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/d9e0300f903aa7cfb85a94480ad544082a7a6c35..f8ece26404c49d25c34d9500c57f78c5c9c93204:/terminal.c diff --git a/terminal.c b/terminal.c index 4f0d8225..996a01fb 100644 --- a/terminal.c +++ b/terminal.c @@ -5262,8 +5262,17 @@ static void clipme(Terminal *term, pos top, pos bottom, int rect, int desel) set = (uc & CSET_MASK); c = (uc & ~CSET_MASK); - cbuf[0] = uc; - cbuf[1] = 0; +#ifdef PLATFORM_IS_UTF16 + if (uc > 0x10000 && uc < 0x110000) { + cbuf[0] = 0xD800 | ((uc - 0x10000) >> 10); + cbuf[1] = 0xDC00 | ((uc - 0x10000) & 0x3FF); + cbuf[2] = 0; + } else +#endif + { + cbuf[0] = uc; + cbuf[1] = 0; + } if (DIRECT_FONT(uc)) { if (c >= ' ' && c != 0x7F) {