2 Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
3 See the file copying.txt for copying permission.
10 #define WIN32_LEAN_AND_MEAN 1
14 int codepageMap(int cp, int *map)
18 if (!GetCPInfo(cp, &info) || info.MaxCharSize > 2)
20 for (i = 0; i < 256; i++)
22 if (info.MaxCharSize > 1) {
23 for (i = 0; i < MAX_LEADBYTES; i++) {
25 if (info.LeadByte[i] == 0 && info.LeadByte[i + 1] == 0)
27 lim = info.LeadByte[i + 1];
28 for (j = info.LeadByte[i]; j < lim; j++)
32 for (i = 0; i < 256; i++) {
36 if (MultiByteToWideChar(cp, MB_PRECOMPOSED|MB_ERR_INVALID_CHARS,
44 int codepageConvert(int cp, const char *p)
47 if (MultiByteToWideChar(cp, MB_PRECOMPOSED|MB_ERR_INVALID_CHARS,
55 int codepageMap(int cp, int *map)
60 int codepageConvert(int cp, const char *p)
65 #endif /* not WIN32 */