diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-14 16:06:33 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-14 16:06:33 +0000 |
| commit | 8eda80ff2cde551e22e9a9803e932184aafdbf38 (patch) | |
| tree | 47cc804c9faf9827adaa3ed799fd2eacfd5c31f0 /test | |
| parent | c9453ecc049269a637d5d39daa927fc9b4a462b0 (diff) | |
* transcode.c (econv_primitive_convert): set destination_buffer
encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18630 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 98ed310504..af846ad45b 100644 --- a/test/ruby/test_econv.rb +++ b/test/ruby/test_econv.rb @@ -31,6 +31,14 @@ class TestEncodingConverter < Test::Unit::TestCase assert_equal(Encoding::EUC_JP, ec.destination_encoding) end + def test_result_encoding + ec = Encoding::Converter.new("UTF-8", "EUC-JP") + dst = "".force_encoding("ASCII-8BIT") + assert_equal(Encoding::ASCII_8BIT, dst.encoding) + ec.primitive_convert("\u{3042}", dst, nil, 10) + assert_equal(Encoding::EUC_JP, dst.encoding) + end + def test_output_region ec = Encoding::Converter.new("UTF-8", "EUC-JP") ec.primitive_convert(src="a", dst="b", nil, 1, Encoding::Converter::PARTIAL_INPUT) |
