From be36df7f55a073e7fcb677497dfaf3c0bab12278 Mon Sep 17 00:00:00 2001 From: usa Date: Tue, 2 Apr 2013 04:13:32 +0000 Subject: merge revision(s) 35112,35121: [Backport #6190] * transcode.c (str_encode_bang, encoded_dup): if nothing was transcoded, just set encoding but leave coderange unchanged as forcee_encoding. [ruby-core:43557][Bug #6190] * transcode.c (documentation for str_encode): Explain that transcoding to the same encoding is a no-op (i.e. no exceptions, no replacements,...). [ruby-core:43557][Bug #6190] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@40056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_m17n.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb index 3553f3a0a4..699c8151dd 100644 --- a/test/ruby/test_m17n.rb +++ b/test/ruby/test_m17n.rb @@ -1369,6 +1369,14 @@ class TestM17N < Test::Unit::TestCase assert_equal(true, s.valid_encoding?) s << "\xff".force_encoding("utf-16be") assert_equal(false, s.valid_encoding?, bug4018) + + bug6190 = '[ruby-core:43557]' + s = "\xe9" + s = s.encode("utf-8", "utf-8") + assert_equal(false, s.valid_encoding?, bug6190) + s = "\xe9" + s.encode!("utf-8", "utf-8") + assert_equal(false, s.valid_encoding?, bug6190) end def test_getbyte -- cgit v1.2.3