From ece0628ebe83bce6968f7f47ce5898266b8e8410 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 15 Jan 2009 04:10:16 +0000 Subject: * configure.in, win32/Makefile.sub (MISSING): added langinfo on mingw and mswin. * encoding.c (rb_locale_charmap): use environments on mingw and mswin. * missing/langinfo.c (nl_langinfo_codeset): MS-Windows Japanese environment uses Windows-31J derived from Shift_JIS, not EUC-JP. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- missing/langinfo.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'missing') diff --git a/missing/langinfo.c b/missing/langinfo.c index bbc81f5c41..a76000bc77 100644 --- a/missing/langinfo.c +++ b/missing/langinfo.c @@ -36,7 +36,6 @@ #include #if defined _WIN32 || defined __CYGWIN__ #include -int snprintf(char *, size_t, const char *, ...); #if defined _WIN32 #define strncasecmp strnicmp #endif @@ -49,6 +48,12 @@ int snprintf(char *, size_t, const char *, ...); * C/POSIX locale. Could as well one day * become "UTF-8". */ +#if defined _WIN32 || defined __CYGWIN__ +#define JA_CODESET "Windows-31J" +#else +#define JA_CODESET "EUC-JP" +#endif + #define digit(x) ((x) >= '0' && (x) <= '9') #define strstart(s, n) (strncasecmp(s, n, strlen(n)) == 0) @@ -94,7 +99,7 @@ nl_langinfo_codeset(void) if (strstart(l, "zh_TW")) return "Big5"; if (strstart(l, "zh_HK")) return "Big5HKSCS"; /* no MIME charset */ if (strstart(l, "zh")) return "GB2312"; - if (strstart(l, "ja")) return "EUC-JP"; + if (strstart(l, "ja")) return JA_CODESET; if (strstart(l, "ko")) return "EUC-KR"; if (strstart(l, "ru")) return "KOI8-R"; if (strstart(l, "uk")) return "KOI8-U"; -- cgit v1.2.3