From bfe5f25dc7f31fad380de6d574416c2da21d4973 Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 8 Sep 2008 17:23:37 +0000 Subject: * include/ruby/encoding.h (rb_econv_decorate_at_first): declared. (rb_econv_decorate_at_last): declared. * transcode.c (rb_econv_open_by_transcoder_entries): initialize replacement_enc. allocate outbuf for the last transcoder. (rb_econv_open0): extracted from rb_econv_open. (rb_econv_open): use rb_econv_open0 and decorate the result using rb_econv_decorate_at_first and rb_econv_decorate_at_last. (rb_econv_decorate_at): new function. (rb_econv_decorate_at_first): ditto. (rb_econv_decorate_at_last): ditto. (rb_econv_binmode): fix iteration end condition. (econv_init): don't set source_encoding_name and destination_encoding_name because they are set in rb_econv_open0. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_econv.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb index 1b2586a04..a82105a3f 100644 --- a/test/ruby/test_econv.rb +++ b/test/ruby/test_econv.rb @@ -68,13 +68,13 @@ class TestEncodingConverter < Test::Unit::TestCase end def test_newline_converter_with_ascii_incompatible - assert_raise(Encoding::NoConverter) { + assert_nothing_raised { Encoding::Converter.new("UTF-8", "UTF-16BE", Encoding::Converter::UNIVERSAL_NEWLINE_DECODER) } - assert_raise(Encoding::NoConverter) { + assert_nothing_raised { Encoding::Converter.new("UTF-16BE", "UTF-8", Encoding::Converter::CRLF_NEWLINE_ENCODER) } - assert_raise(Encoding::NoConverter) { + assert_nothing_raised { Encoding::Converter.new("UTF-16BE", "UTF-8", Encoding::Converter::CR_NEWLINE_ENCODER) } -- cgit