From 0859e7cb87a23a0e80e26d3942730d19db26834d Mon Sep 17 00:00:00 2001 From: naruse Date: Fri, 6 Nov 2009 00:33:56 +0000 Subject: [PATCH] * encoding.c (rb_filesystem_encindex): add fallback to ASCII-8BIT on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ encoding.c | 1 + 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index a31c76dc7c..86b9078e45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Nov 6 09:29:32 2009 NARUSE, Yui + + * encoding.c (rb_filesystem_encindex): add fallback to + ASCII-8BIT on Windows. + Fri Nov 6 07:29:07 2009 Kazuhiro NISHIYAMA * test/ruby/test_case.rb: merged r25658 from ruby_1_8. diff --git a/encoding.c b/encoding.c index 38a0cf9c7c..97d930701b 100644 --- a/encoding.c +++ b/encoding.c @@ -1125,6 +1125,7 @@ rb_filesystem_encindex(void) char cp[sizeof(int) * 8 / 3 + 4]; snprintf(cp, sizeof cp, "CP%d", AreFileApisANSI() ? GetACP() : GetOEMCP()); idx = rb_enc_find_index(cp); + if (idx < 0) idx = rb_ascii8bit_encindex(); #elif defined __APPLE__ idx = rb_utf8_encindex(); #else