diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-05 21:29:12 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-05 21:29:12 +0000 |
commit | a10a5ddaacb05368cee3beec82af47043aec6667 (patch) | |
tree | 6b90181b6b7e94ffa5b641134af629a41080d8e9 /test/ruby | |
parent | fb9c53dea50fbbf7d789f0cac004a00c6d125022 (diff) | |
download | ruby-a10a5ddaacb05368cee3beec82af47043aec6667.tar.gz |
* enc/trans/escape.trans: new file.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_econv.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb index 0a774c4a7a..be4917ddf7 100644 --- a/test/ruby/test_econv.rb +++ b/test/ruby/test_econv.rb @@ -692,5 +692,19 @@ class TestEncodingConverter < Test::Unit::TestCase ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1", Encoding::Converter::UNDEF_HEX_CHARREF) assert_equal("交換法則: n\xD7m=m\xD7n".force_encoding("ISO-8859-1"), ec.convert("\xB8\xF2\xB4\xB9\xCB\xA1\xC2\xA7: n\xA1\xDFm=m\xA1\xDFn")) + + ec = Encoding::Converter.new("UTF-8", "US-ASCII", Encoding::Converter::UNDEF_HEX_CHARREF) + assert_equal("&", ec.convert("&")) + end + + def test_html_escape + ec = Encoding::Converter.new("", "amp-escaped") + assert_equal('&<>"', ec.convert("&<>\"")) + + ec = Encoding::Converter.new("", "html-text-escaped") + assert_equal('&<>"', ec.convert("&<>\"")) + + ec = Encoding::Converter.new("", "html-attr-escaped") + assert_equal('&<>"', ec.convert("&<>\"")) end end |