diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-03 15:19:24 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-03 15:19:24 +0000 |
commit | 5a2758ed1e59fcb6e2f2c75a2e7412485f34927e (patch) | |
tree | 3da23acf1dd67c5265b8531e3535b469f22b3cc6 | |
parent | ac46d76ce83e8ccf5ec20ea0b671175dbeb0cdee (diff) | |
download | ruby-5a2758ed1e59fcb6e2f2c75a2e7412485f34927e.tar.gz |
* encoding.c (rb_locale_charmap): ignore calling nl_langinfo_codeset()
on Windows except cygwin. [experimental]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | encoding.c | 7 |
2 files changed, 10 insertions, 2 deletions
@@ -1,3 +1,8 @@ +Thu Nov 3 23:53:04 2011 NAKAMURA Usaku <usa@ruby-lang.org> + + * encoding.c (rb_locale_charmap): ignore calling nl_langinfo_codeset() + on Windows except cygwin. [experimental] + Thu Nov 3 22:45:09 2011 Tanaka Akira <akr@fsij.org> * ext/socket/socket.c (rsock_socketpair0): extracted from diff --git a/encoding.c b/encoding.c index 3e4892b2e2..0aac1f1509 100644 --- a/encoding.c +++ b/encoding.c @@ -1446,9 +1446,12 @@ rb_locale_charmap(VALUE klass) #if defined NO_LOCALE_CHARMAP return rb_usascii_str_new2("ASCII-8BIT"); #elif defined _WIN32 || defined __CYGWIN__ - const char *nl_langinfo_codeset(void); - const char *codeset = nl_langinfo_codeset(); + const char *codeset = 0; char cp[sizeof(int) * 3 + 4]; +# ifdef __CYGWIN__ + const char *nl_langinfo_codeset(void); + codeset = nl_langinfo_codeset(); +# endif if (!codeset) { UINT codepage = GetConsoleCP(); if(!codepage) codepage = GetACP(); |