summaryrefslogtreecommitdiffstats
path: root/missing
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
commit125f24d094c7aec126225858eb11799c7c4785fa (patch)
treec8b37c4eff2aee9bb91ed7fa70d9a280f18b2c54 /missing
parentc955acc19cbc8b58f6aa0236cb677831199a3767 (diff)
downloadruby-125f24d094c7aec126225858eb11799c7c4785fa.tar.gz
ruby-125f24d094c7aec126225858eb11799c7c4785fa.tar.xz
ruby-125f24d094c7aec126225858eb11799c7c4785fa.zip
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@21517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'missing')
-rw-r--r--missing/langinfo.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/missing/langinfo.c b/missing/langinfo.c
index bbc81f5c4..a76000bc7 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";