summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-05 08:26:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-05 08:26:26 +0000
commit5e3467c4414df815b3b00d2b0372026b069e7f7d (patch)
tree233a0cee0dbe09463fe64e341d671295659af172 /test
parent613737eee9168db483206bcac65c83413be02f42 (diff)
hash.c: env encoding fallback on Windows
* hash.c (env_str_new, env_path_str_new): make default string UTF-8 for the case conversion is not possible. [Bug #8822] * hash.c (get_env_cstr): convert non-ASCII string to UTF-8 string. * hash.c (ruby_setenv): use wide char version to put environment variable to deal with non-ASCII value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_env.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_env.rb b/test/ruby/test_env.rb
index 070e10464e..364f88e00a 100644
--- a/test/ruby/test_env.rb
+++ b/test/ruby/test_env.rb
@@ -482,5 +482,16 @@ class TestEnv < Test::Unit::TestCase
500.times(&doit)
end;
end
+
+ if Encoding.find("locale") == Encoding::UTF_8
+ def test_utf8
+ text = "testing åáâäãāあ"
+ test = ENV["test"]
+ ENV["test"] = text
+ assert_equal text, ENV["test"]
+ ensure
+ ENV["test"] = test
+ end
+ end
end
end