38 #if defined _WIN32 || defined __CYGWIN__ 40 #if defined _WIN32 && !defined strncasecmp 41 #define strncasecmp strnicmp 44 #ifdef HAVE_LANGINFO_H 48 #define C_CODESET "US-ASCII" 52 #if defined _WIN32 || defined __CYGWIN__ 53 #define JA_CODESET "Windows-31J" 55 #define JA_CODESET "EUC-JP" 58 #define digit(x) ((x) >= '0' && (x) <= '9') 59 #define strstart(s, n) (strncasecmp((s), (n), strlen(n)) == 0) 69 if (((l =
getenv(
"LC_ALL")) && *l) ||
70 ((l =
getenv(
"LC_CTYPE")) && *l) ||
71 ((l =
getenv(
"LANG")) && *l)) {
73 if (!strcmp(l,
"C") || !strcmp(l,
"POSIX"))
83 memcpy(
buf,
"ISO-8859-\0\0", 12);
89 if (
strstart(p,
"KOI8-R"))
return "KOI8-R";
90 if (
strstart(p,
"KOI8-U"))
return "KOI8-U";
91 if (
strstart(p,
"620"))
return "TIS-620";
92 if (
strstart(p,
"2312"))
return "GB2312";
93 if (
strstart(p,
"HKSCS"))
return "Big5HKSCS";
94 if (
strstart(p,
"BIG5"))
return "Big5";
95 if (
strstart(p,
"GBK"))
return "GBK";
96 if (
strstart(p,
"18030"))
return "GB18030";
99 if (
strstart(p,
"euro"))
return "ISO-8859-15";
101 if (
strstart(l,
"zh_TW"))
return "Big5";
102 if (
strstart(l,
"zh_HK"))
return "Big5HKSCS";
103 if (
strstart(l,
"zh"))
return "GB2312";
105 if (
strstart(l,
"ko"))
return "EUC-KR";
106 if (
strstart(l,
"ru"))
return "KOI8-R";
107 if (
strstart(l,
"uk"))
return "KOI8-U";
112 if (
strstart(l,
"el"))
return "ISO-8859-7";
113 if (
strstart(l,
"he"))
return "ISO-8859-8";
114 if (
strstart(l,
"tr"))
return "ISO-8859-9";
115 if (
strstart(l,
"th"))
return "TIS-620";
116 if (
strstart(l,
"lt"))
return "ISO-8859-13";
117 if (
strstart(l,
"cy"))
return "ISO-8859-14";
118 if (
strstart(l,
"ro"))
return "ISO-8859-2";
127 #ifdef HAVE_LANGINFO_H 128 char *nl_langinfo(nl_item item)
135 return (
char *)codeset;
145 printf(
"%s\n", nl_langinfo(CODESET));
const char * nl_langinfo_codeset(void)
unsigned char buf[MIME_BUF_SIZE]
char * strchr(char *, char)
int main(int argc, char **argv)