ruby-changes:17954
From: duerst <ko1@a...>
Date: Mon, 29 Nov 2010 18:33:14 +0900 (JST)
Subject: [ruby-changes:17954] Ruby:r29970 (trunk): test/ruby/test_transcode.rb (test_unicode_public_review_issue_121):
duerst 2010-11-29 18:33:08 +0900 (Mon, 29 Nov 2010) New Revision: 29970 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29970 Log: 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. Modified files: trunk/ChangeLog trunk/test/ruby/test_transcode.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 29969) +++ ChangeLog (revision 29970) @@ -1,3 +1,9 @@ +Mon Nov 29 18:31:31 2010 Martin Duerst <duerst@i...> + + * 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. + Mon Nov 29 14:31:17 2010 NAKAMURA Usaku <usa@r...> * win32/win32.c (rb_w32_isatty): use GetConsoleMode() to determine the Index: test/ruby/test_transcode.rb =================================================================== --- test/ruby/test_transcode.rb (revision 29969) +++ test/ruby/test_transcode.rb (revision 29970) @@ -1404,14 +1404,16 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/