ruby-changes:34459
From: nobu <ko1@a...>
Date: Tue, 24 Jun 2014 11:19:15 +0900 (JST)
Subject: [ruby-changes:34459] nobu:r46540 (trunk): hash.c: replace undef
nobu 2014-06-24 11:19:09 +0900 (Tue, 24 Jun 2014) New Revision: 46540 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46540 Log: hash.c: replace undef * hash.c (env_str_new, env_path_str_new): replace invalid or undefined conversions. Modified files: trunk/hash.c Index: hash.c =================================================================== --- hash.c (revision 46539) +++ hash.c (revision 46540) @@ -2504,7 +2504,9 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/hash.c#L2504 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 https://github.com/ruby/ruby/blob/trunk/hash.c#L2519 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/