+#ifdef WINDOWS
#include <windows.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include "putty.h"
#include "misc.h"
-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
* equivalents mapped to their unicode 3.0 locations.
widesize = len * 2;
}
- wclen =
- MultiByteToWideChar(codepage, 0, buf, len, widebuffer, widesize);
+ wclen = mb_to_wc(codepage, 0, buf, len, widebuffer, widesize);
luni_send(widebuffer, wclen, interactive);
}
}
} else if (!uni_tbl) {
int rv;
- rv = WideCharToMultiByte(line_codepage, 0, widebuf, len,
- linebuffer, linesize, NULL, NULL);
+ rv = wc_to_mb(line_codepage, 0, widebuf, len,
+ linebuffer, linesize, NULL, NULL);
if (rv >= 0)
p = linebuffer + rv;
else
return cp_list[index].name;
}
-static void get_unitab(int codepage, wchar_t * unitab, int ftype)
+void get_unitab(int codepage, wchar_t * unitab, int ftype)
{
char tbuf[4];
int i, max = 256, flg = MB_ERR_INVALID_CHARS;
for (i = 0; i < max; i++) {
tbuf[0] = i;
- if (MultiByteToWideChar(codepage, flg, tbuf, 1, unitab + i, 1)
+ if (mb_to_wc(codepage, flg, tbuf, 1, unitab + i, 1)
!= 1)
unitab[i] = 0xFFFD;
}