diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-04-26 14:21:43 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-04-26 14:21:43 +0000 |
commit | 4a3a6f8f6ccb0506e52cb49c91e56cf769a883c2 (patch) | |
tree | 4db01785252dfa55c2e70d51dcf6886718d95220 /test | |
parent | 777c450ecf556c0688a5c314dbc8b4152c43537a (diff) | |
download | ruby-4a3a6f8f6ccb0506e52cb49c91e56cf769a883c2.tar.gz ruby-4a3a6f8f6ccb0506e52cb49c91e56cf769a883c2.tar.xz ruby-4a3a6f8f6ccb0506e52cb49c91e56cf769a883c2.zip |
* enc/trans/utf8_mac.trans: Add converter for UTF8-MAC.
* enc/trans/utf8_mac-tbl.rb: ditto.
* test/ruby/test_econv.rb: tests for above.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_econv.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb index 031efdd7d..5fce12da8 100644 --- a/test/ruby/test_econv.rb +++ b/test/ruby/test_econv.rb @@ -878,4 +878,12 @@ class TestEncodingConverter < Test::Unit::TestCase "".encode("euc-jp", :undef => :replace, :replace => broken) } end + + def test_utf8_mac + assert_equal("\u{fb4d}", "\u05DB\u05BF".encode("UTF-8", "UTF8-MAC")) + assert_equal("\u{1ff7}", "\u03C9\u0345\u0342".encode("UTF-8", "UTF8-MAC")) + + assert_equal("\u05DB\u05BF", "\u{fb4d}".encode("UTF8-MAC").force_encoding("UTF-8")) + assert_equal("\u03C9\u0345\u0342", "\u{1ff7}".encode("UTF8-MAC").force_encoding("UTF-8")) + end end |