diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-14 14:28:10 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-14 14:28:10 +0000 |
| commit | 14a85c09bda3fe65509e1e681aff76af00418284 (patch) | |
| tree | 534a3869838473b1443fcfa11c036773d0962d93 /test/ruby | |
| parent | 0ed71114e96ccb7ff0e63549ec7c0c15bfae968d (diff) | |
| download | ruby-14a85c09bda3fe65509e1e681aff76af00418284.tar.gz ruby-14a85c09bda3fe65509e1e681aff76af00418284.tar.xz ruby-14a85c09bda3fe65509e1e681aff76af00418284.zip | |
* include/ruby/encoding.h (rb_econv_result_t): moved from
transcode_data.h.
(rb_econv_elem_t): ditto.
(rb_econv_t): ditto. source_encoding and destination_encoding field
is added.
(rb_econv_open): declared.
(rb_econv_convert): ditto.
(rb_econv_close): ditto.
* transcode.c (rb_econv_open_by_transcoder_entries): initialize
source_encoding and destination_encoding field as NULL.
(rb_econv_open): make it external linkage.
(rb_econv_close): ditto.
(rb_econv_convert): ditto. renamed from rb_econv_conv.
(make_encoding): new function.
(econv_init): use make_encoding and store rb_encoding* in
rb_econv_t.
(econv_source_encoding): new method
Encoding::Converter#source_encoding.
(econv_destination_encoding): new method
Encoding::Converter#destination_encoding.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_econv.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb index 239489fdd..98ed31050 100644 --- a/test/ruby/test_econv.rb +++ b/test/ruby/test_econv.rb @@ -25,6 +25,12 @@ class TestEncodingConverter < Test::Unit::TestCase assert_kind_of(Encoding::Converter, Encoding::Converter.new(Encoding::UTF_8, Encoding::EUC_JP)) end + def test_get_encoding + ec = Encoding::Converter.new("UTF-8", "EUC-JP") + assert_equal(Encoding::UTF_8, ec.source_encoding) + assert_equal(Encoding::EUC_JP, ec.destination_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) |
