summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-23 10:48:56 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-23 10:48:56 +0000
commitf33246daebe70dc8ea62918fe8ef62f775676ec9 (patch)
tree3ef8c4cb4f33088a6e9bbfdcd276b7412303bcc1 /test
parent32d4fcdc92ebf85c90ab53d9a7743f884e3a623a (diff)
merges r29970 from trunk into ruby_1_9_2.
-- test/ruby/test_transcode.rb (test_unicode_public_review_issue_121): - Removed commented-out options that are no longer under discussion. - Added two more tests for forthcomming clarifications. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_transcode.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/ruby/test_transcode.rb b/test/ruby/test_transcode.rb
index 1b15a5b556..a47184e970 100644
--- a/test/ruby/test_transcode.rb
+++ b/test/ruby/test_transcode.rb
@@ -1389,14 +1389,16 @@ class TestTranscode < Test::Unit::TestCase
end
def test_unicode_public_review_issue_121 # see http://www.unicode.org/review/pr-121.html
- # assert_equal("\x00\x61\xFF\xFD\x00\x62".force_encoding('UTF-16BE'),
- # "\x61\xF1\x80\x80\xE1\x80\xC2\x62".encode('UTF-16BE', 'UTF-8', invalid: :replace)) # option 1
assert_equal("\x00\x61\xFF\xFD\xFF\xFD\xFF\xFD\x00\x62".force_encoding('UTF-16BE'),
"\x61\xF1\x80\x80\xE1\x80\xC2\x62".encode('UTF-16BE', 'UTF-8', invalid: :replace)) # option 2
assert_equal("\x61\x00\xFD\xFF\xFD\xFF\xFD\xFF\x62\x00".force_encoding('UTF-16LE'),
"\x61\xF1\x80\x80\xE1\x80\xC2\x62".encode('UTF-16LE', 'UTF-8', invalid: :replace)) # option 2
- # assert_equal("\x00\x61\xFF\xFD\xFF\xFD\xFF\xFD\xFF\xFD\xFF\xFD\xFF\xFD\x00\x62".force_encoding('UTF-16BE'),
- # "\x61\xF1\x80\x80\xE1\x80\xC2\x62".encode('UTF-16BE', 'UTF-8', invalid: :replace)) # option 3
+
+ # additional clarification
+ assert_equal("\xFF\xFD\xFF\xFD\xFF\xFD\xFF\xFD".force_encoding('UTF-16BE'),
+ "\xF0\x80\x80\x80".encode('UTF-16BE', 'UTF-8', invalid: :replace))
+ assert_equal("\xFD\xFF\xFD\xFF\xFD\xFF\xFD\xFF".force_encoding('UTF-16LE'),
+ "\xF0\x80\x80\x80".encode('UTF-16LE', 'UTF-8', invalid: :replace))
end
def test_yen_sign