diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-24 02:19:09 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-24 02:19:09 +0000 |
commit | 9a6518abf71e5de3d5dee21152dd4cff6730b640 (patch) | |
tree | 8c25cef29b511565fe13733509c0fa759f850137 /hash.c | |
parent | bc7919a9cd5f521a6c901000bf9f6055018a0cf4 (diff) | |
download | ruby-9a6518abf71e5de3d5dee21152dd4cff6730b640.tar.gz |
hash.c: replace undef
* hash.c (env_str_new, env_path_str_new): replace invalid or
undefined conversions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -2504,7 +2504,9 @@ static VALUE env_str_new(const char *ptr, long len) { #ifdef _WIN32 - VALUE str = rb_str_conv_enc(rb_str_new(ptr, len), rb_utf8_encoding(), rb_locale_encoding()); + VALUE str = rb_str_conv_enc_opts(rb_str_new(ptr, len), + rb_utf8_encoding(), rb_locale_encoding(), + ECONV_INVALID_REPLACE | ECONV_UNDEF_REPLACE, Qnil); #else VALUE str = rb_locale_str_new(ptr, len); #endif @@ -2517,8 +2519,9 @@ static VALUE env_path_str_new(const char *ptr) { #ifdef _WIN32 - VALUE str = rb_enc_str_new_cstr(ptr, rb_utf8_encoding()); - str = rb_str_conv_enc(str, NULL, rb_filesystem_encoding()); + VALUE str = rb_str_conv_enc_opts(rb_str_new_cstr(ptr), + rb_utf8_encoding(), rb_filesystem_encoding(), + ECONV_INVALID_REPLACE | ECONV_UNDEF_REPLACE, Qnil); #else VALUE str = rb_filesystem_str_new_cstr(ptr); #endif |