From: simon Date: Fri, 7 Sep 2001 22:58:00 +0000 (+0000) Subject: Another patch from RDB: prevent luni_send from sending a particular X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/05054a303c0c056d78f258970a5834ee28efe40c 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. git-svn-id: svn://svn.tartarus.org/sgt/putty@1246 cda61777-01e9-0310-a592-d414129be87e --- 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) {