aboutsummaryrefslogtreecommitdiffstats
path: root/missing/langinfo.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-15 04:10:16 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-15 04:10:16 +0000
commitece0628ebe83bce6968f7f47ce5898266b8e8410 (patch)
treec8b37c4eff2aee9bb91ed7fa70d9a280f18b2c54 /missing/langinfo.c
parent9e99ce38313cda42a4e2c6c0dba8d1356eec2c7f (diff)
downloadruby-ece0628ebe83bce6968f7f47ce5898266b8e8410.tar.gz
* 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
Diffstat (limited to 'missing/langinfo.c')
-rw-r--r--missing/langinfo.c9
1 files changed, 7 insertions, 2 deletions
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 <string.h>
#if defined _WIN32 || defined __CYGWIN__
#include <windows.h>
-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";