| /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd |
| See the file COPYING for copying permission. |
| #if (defined(WIN32) || (defined(__WATCOMC__) && defined(__NT__))) |
| #define WIN32_LEAN_AND_MEAN 1 |
| codepageMap(int cp, int *map) |
| if (!GetCPInfo(cp, &info) || info.MaxCharSize > 2) |
| for (i = 0; i < 256; i++) |
| if (info.MaxCharSize > 1) { |
| for (i = 0; i < MAX_LEADBYTES; i+=2) { |
| if (info.LeadByte[i] == 0 && info.LeadByte[i + 1] == 0) |
| lim = info.LeadByte[i + 1]; |
| for (j = info.LeadByte[i]; j <= lim; j++) |
| for (i = 0; i < 256; i++) { |
| if (MultiByteToWideChar(cp, MB_PRECOMPOSED|MB_ERR_INVALID_CHARS, |
| codepageConvert(int cp, const char *p) |
| if (MultiByteToWideChar(cp, MB_PRECOMPOSED|MB_ERR_INVALID_CHARS, |
| codepageMap(int cp, int *map) |
| codepageConvert(int cp, const char *p) |