summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-31 07:37:10 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-31 07:37:10 +0000
commitd1429c3cc6405a23b10c317c0ffdac96c9a7e61f (patch)
tree74a2d2d55e5a6fc3f209f786929429a6040da438 /test
parentae9af4d3337c7ad82eff221028c1d58b5f44f659 (diff)
* enc/trans/single_byte.trans (us_ascii_map): don't define 8bit bytes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_econv.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb
index 917b46c629..a704b05ed0 100644
--- a/test/ruby/test_econv.rb
+++ b/test/ruby/test_econv.rb
@@ -613,4 +613,19 @@ class TestEncodingConverter < Test::Unit::TestCase
assert_kind_of(Encoding::InvalidByteSequence, ec.last_error)
end
+ def test_us_ascii
+ ec = Encoding::Converter.new("UTF-8", "US-ASCII")
+ ec.primitive_convert(src="\u{3042}", dst="")
+ err = ec.last_error
+ assert_kind_of(Encoding::ConversionUndefined, err)
+ assert_equal("\u{3042}", err.error_char)
+ end
+
+ def test_88591
+ ec = Encoding::Converter.new("UTF-8", "ISO-8859-1")
+ ec.primitive_convert(src="\u{3042}", dst="")
+ err = ec.last_error
+ assert_kind_of(Encoding::ConversionUndefined, err)
+ assert_equal("\u{3042}", err.error_char)
+ end
end