summaryrefslogtreecommitdiff
path: root/missing
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-15 15:39:56 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-15 15:39:56 +0000
commit2f2497ee534fe7cdc5ffab2bda5e7446b9f42b76 (patch)
tree3f627152b86976f39249d246480e32807b2523ef /missing
parent2a71b1ca87fbb96e1d4fe6ed598d6e931034d0c4 (diff)
merges r21517 and r21519 from trunk into ruby_1_9_1.
* 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/branches/ruby_1_9_1@21565 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 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";