]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Another patch from RDB: prevent luni_send from sending a particular
authorSimon Tatham <anakin@pobox.com>
Fri, 7 Sep 2001 22:58:00 +0000 (22:58 +0000)
committerSimon Tatham <anakin@pobox.com>
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.

[originally from svn r1246]

unicode.c

index c3e1051994a79645a4b8f463d3dfcc4c087ace1b..e1740dad29bcd3afbc6f07456cafb722020229be 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) {