mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Encoding.default_internal should affect ENV on Windows like other platforms
* hash.c (env_str_transcode): call rb_external_str_with_enc() if default_internal is available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
512db21900
commit
f4b9134842
1 changed files with 9 additions and 2 deletions
11
hash.c
11
hash.c
|
@ -3070,8 +3070,15 @@ extern char **environ;
|
|||
static VALUE
|
||||
env_str_transcode(VALUE str, rb_encoding *enc)
|
||||
{
|
||||
return rb_str_conv_enc_opts(str, NULL, enc,
|
||||
ECONV_INVALID_REPLACE | ECONV_UNDEF_REPLACE, Qnil);
|
||||
rb_encoding *internal = rb_default_internal_encoding();
|
||||
if (!internal) {
|
||||
return rb_str_conv_enc_opts(str, NULL, enc,
|
||||
ECONV_INVALID_REPLACE | ECONV_UNDEF_REPLACE,
|
||||
Qnil);
|
||||
}
|
||||
else {
|
||||
return rb_external_str_with_enc(str, rb_utf8_encoding());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue