Another patch from RDB: prevent luni_send from sending a particular
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 7 Sep 2001 22:58:00 +0000 (22:58 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 7 Sep 2001 22:58:00 +0000 (22:58 +0000)
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

unicode.c

index c3e1051..e1740da 100644 (file)
--- 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) {