1 /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
2 See the file COPYING for copying permission.
6 #include "internal.h" /* for UNUSED_P only */
8 #if (defined(WIN32) || (defined(__WATCOMC__) && defined(__NT__)))
10 #define WIN32_LEAN_AND_MEAN 1
15 codepageMap(int cp, int *map)
19 if (!GetCPInfo(cp, &info) || info.MaxCharSize > 2)
21 for (i = 0; i < 256; i++)
23 if (info.MaxCharSize > 1) {
24 for (i = 0; i < MAX_LEADBYTES; i+=2) {
26 if (info.LeadByte[i] == 0 && info.LeadByte[i + 1] == 0)
28 lim = info.LeadByte[i + 1];
29 for (j = info.LeadByte[i]; j <= lim; j++)
33 for (i = 0; i < 256; i++) {
37 if (MultiByteToWideChar(cp, MB_PRECOMPOSED|MB_ERR_INVALID_CHARS,
46 codepageConvert(int cp, const char *p)
49 if (MultiByteToWideChar(cp, MB_PRECOMPOSED|MB_ERR_INVALID_CHARS,
58 codepageMap(int UNUSED_P(cp), int *UNUSED_P(map))
64 codepageConvert(int UNUSED_P(cp), const char *UNUSED_P(p))
69 #endif /* not WIN32 */