mirror of
https://github.com/ruby/ruby.git
synced 2025-09-19 02:23:59 +02:00
* transcode.c (str_encode): returns duplicated string if nothing
changed. [ruby-core:18578] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ca36233e55
commit
2f67b43aec
3 changed files with 17 additions and 1 deletions
|
@ -582,4 +582,10 @@ class TestTranscode < Test::Unit::TestCase
|
|||
assert_raise(Encoding::ConversionUndefined) { "\u203E".encode("CP51932") }
|
||||
end
|
||||
|
||||
def test_nothing_changed
|
||||
a = "James".force_encoding("US-ASCII")
|
||||
b = a.encode("Shift_JIS")
|
||||
assert_equal(Encoding::US_ASCII, a.encoding)
|
||||
assert_equal(Encoding::Shift_JIS, b.encoding)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue