mirror of
https://github.com/ruby/ruby.git
synced 2025-08-28 15:36:16 +02:00
* string.c (rb_str_inspect): fix for ascii-compatible external
encoding and different encoding string. [ruby-core:33283] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5d8a64b1af
commit
94e6c0c233
3 changed files with 14 additions and 1 deletions
|
@ -1897,6 +1897,14 @@ class TestString < Test::Unit::TestCase
|
|||
assert_equal('"\\u3042\\u3044\\u3046"', "\u3042\u3044\u3046".encode(e).inspect)
|
||||
assert_equal('"ab\\"c"', "ab\"c".encode(e).inspect, bug4081)
|
||||
end
|
||||
begin
|
||||
ext = Encoding.default_external
|
||||
Encoding.default_external = "us-ascii"
|
||||
i = "abc\"\\".force_encoding("utf-8").inspect
|
||||
ensure
|
||||
Encoding.default_external = ext
|
||||
end
|
||||
assert_equal('"abc\\"\\\\"', i, bug4081)
|
||||
end
|
||||
|
||||
def test_prepend
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue