From 5768c6700dbe1f50cac24f68626bc4f3030ca6ea Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 7 Sep 2001 22:58:00 +0000 Subject: [PATCH] Another patch from RDB: prevent luni_send from sending a particular range of Unicode characters. Not entirely sure I understand this one but I trust that RDB knows what he's talking about with Unicode. [originally from svn r1246] --- unicode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/unicode.c b/unicode.c index c3e10519..e1740dad 100644 --- a/unicode.c +++ b/unicode.c @@ -474,6 +474,9 @@ void luni_send(wchar_t * widebuf, int len) /* UTF is a simple algorithm */ for (p = linebuffer, i = 0; i < len; i++) { wchar_t ch = widebuf[i]; + /* Windows wchar_t is UTF-16 */ + if ((ch&0xF800) == 0xD800) ch = '.'; + if (ch < 0x80) { *p++ = (char) (ch); } else if (ch < 0x800) {