RDB also points out we don't need the CJK `not recommended for
[sgt/putty] / unicode.c
index ad14b32..e1740da 100644 (file)
--- a/unicode.c
+++ b/unicode.c
@@ -16,7 +16,7 @@ static void get_unitab(int codepage, wchar_t * unitab, int ftype);
 
 /* Character conversion arrays; they are usually taken from windows,
  * the xterm one has the four scanlines that have no unicode 2.0
- * equlivents mapped into the private area.
+ * equivalents mapped to their unicode 3.0 locations.
  */
 static char **uni_tbl;
 
@@ -267,7 +267,7 @@ void init_ucs_tables(void)
     int i, j;
     int used_dtf = 0;
     char tbuf[256];
-    int old_codepage = line_codepage;
+
     for (i = 0; i < 256; i++)
        tbuf[i] = i;
 
@@ -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) {