diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-02-05 15:17:50 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-02-05 15:17:50 +0000 |
commit | b346d7a69cc7e768ee4ac105e53726c87fe1ba0a (patch) | |
tree | 7ef7bf580dcc07cbad180f587ac56510c699cc80 /test | |
parent | 546eeb5f4bd0dfbda947a960e2ec918f8fa2ed14 (diff) | |
download | ruby-b346d7a69cc7e768ee4ac105e53726c87fe1ba0a.tar.gz |
* encoding.c (rb_enc_compatible): return ASCII-8BIT even if 2nd string
is ascii only string. [ruby-core:42354] [Bug #5968]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_encoding.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_encoding.rb b/test/ruby/test_encoding.rb index de96ebd17d..ef2dc39c4d 100644 --- a/test/ruby/test_encoding.rb +++ b/test/ruby/test_encoding.rb @@ -109,5 +109,8 @@ class TestEncoding < Test::Unit::TestCase ua = "abc".force_encoding(Encoding::UTF_8) assert_equal(Encoding::UTF_8, Encoding.compatible?(ua, :abc)) assert_equal(nil, Encoding.compatible?(ua, 1)) + bin = "a".force_encoding(Encoding::ASCII_8BIT) + asc = "b".force_encoding(Encoding::US_ASCII) + assert_equal(Encoding::ASCII_8BIT, Encoding.compatible?(bin, asc)) end end |