From 7f0d337be73bb2465b40009fe23f3b7be6b0dc90 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 26 Sep 2018 17:24:00 +0000 Subject: 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 --- bootstraptest/test_env.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 bootstraptest/test_env.rb (limited to 'bootstraptest') diff --git a/bootstraptest/test_env.rb b/bootstraptest/test_env.rb new file mode 100644 index 0000000000..7d1b45b75e --- /dev/null +++ b/bootstraptest/test_env.rb @@ -0,0 +1,12 @@ +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? +} -- cgit v1.2.3