ruby-changes:52770
From: nagachika <ko1@a...>
Date: Tue, 9 Oct 2018 23:43:12 +0900 (JST)
Subject: [ruby-changes:52770] nagachika:r64982 (ruby_2_5): merge revision(s) 64860, 64861: [Backport #15164]
nagachika 2018-10-09 23:43:06 +0900 (Tue, 09 Oct 2018) New Revision: 64982 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64982 Log: merge revision(s) 64860,64861: [Backport #15164] 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] * properties. Added files: branches/ruby_2_5/bootstraptest/test_env.rb Modified directories: branches/ruby_2_5/ Modified files: branches/ruby_2_5/hash.c branches/ruby_2_5/version.h Index: ruby_2_5/version.h =================================================================== --- ruby_2_5/version.h (revision 64981) +++ ruby_2_5/version.h (revision 64982) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_5/version.h#L1 #define RUBY_VERSION "2.5.2" #define RUBY_RELEASE_DATE "2018-10-09" -#define RUBY_PATCHLEVEL 95 +#define RUBY_PATCHLEVEL 96 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 10 Index: ruby_2_5/bootstraptest/test_env.rb =================================================================== --- ruby_2_5/bootstraptest/test_env.rb (nonexistent) +++ ruby_2_5/bootstraptest/test_env.rb (revision 64982) @@ -0,0 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_5/bootstraptest/test_env.rb#L1 +assert_equal "true", %q{ + ENV["ENVTEST"] = "\u{e9 3042 d76c}" + env = ENV["ENVTEST"] + env.valid_encoding? +} + +# different encoding is used for PATH +assert_equal "true", %q{ + ENV["PATH"] = "\u{e9 3042 d76c}" + env = ENV["PATH"] + env.valid_encoding? +} Property changes on: ruby_2_5/bootstraptest/test_env.rb ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +LF \ No newline at end of property Index: ruby_2_5/hash.c =================================================================== --- ruby_2_5/hash.c (revision 64981) +++ ruby_2_5/hash.c (revision 64982) @@ -3262,7 +3262,7 @@ env_enc_str_new(const char *ptr, long le https://github.com/ruby/ruby/blob/trunk/ruby_2_5/hash.c#L3262 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); Index: ruby_2_5 =================================================================== --- ruby_2_5 (revision 64981) +++ ruby_2_5 (revision 64982) Property changes on: ruby_2_5 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r64860-64861 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/