aboutsummaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-26 17:24:00 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-26 17:24:00 +0000
commit186f9ab8a3436a9f14f77a677b31273ff83fd114 (patch)
tree68af920515bd71a3c13383fd0dbf864e8dc63b22 /hash.c
parent86cb89d7b350bead143c4e1397d89f17ce8520e8 (diff)
downloadruby-186f9ab8a3436a9f14f77a677b31273ff83fd114.tar.gz
fallback env encoding to ASCII-8BIT
* hash.c (env_enc_str_new): as no locale/filesystem encoding is available in miniruby on Windows, fallback the encoding to ASCII-8BIT so it is valid encoding when the conversion failed. [ruby-core:89177] [Bug #15164] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hash.c b/hash.c
index b53bb1660e..ba6053dbfc 100644
--- a/hash.c
+++ b/hash.c
@@ -3360,7 +3360,7 @@ env_enc_str_new(const char *ptr, long len, rb_encoding *enc)
rb_encoding *utf8 = rb_utf8_encoding();
VALUE str = rb_enc_str_new(NULL, 0, (internal ? internal : enc));
if (NIL_P(rb_str_cat_conv_enc_opts(str, 0, ptr, len, utf8, ecflags, Qnil))) {
- rb_str_initialize(str, ptr, len, utf8);
+ rb_str_initialize(str, ptr, len, NULL);
}
#else
VALUE str = rb_external_str_new_with_enc(ptr, len, enc);