diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-29 16:17:26 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-29 16:17:26 +0000 |
commit | 754671ce6662ab6bb23c711892ecfbcaebf37c79 (patch) | |
tree | 70667e0cfc9700f11bc23f1b9ed32ef67a5291bb /test/zlib | |
parent | 9a1e9edd487ed880845cfdee58179fb04ca900ad (diff) | |
download | ruby-754671ce6662ab6bb23c711892ecfbcaebf37c79.tar.gz ruby-754671ce6662ab6bb23c711892ecfbcaebf37c79.tar.xz ruby-754671ce6662ab6bb23c711892ecfbcaebf37c79.zip |
* ext/zlib/zlib.c (gzfile_read_all): use gzfile_newstr;
set and convert its encoding. [ruby-dev:38304]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/zlib')
-rw-r--r-- | test/zlib/test_zlib.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/zlib/test_zlib.rb b/test/zlib/test_zlib.rb index aa3059d5b..abb3ea32b 100644 --- a/test/zlib/test_zlib.rb +++ b/test/zlib/test_zlib.rb @@ -470,10 +470,12 @@ if defined? Zlib def test_read t = Tempfile.new("test_zlib_gzip_reader") t.close - Zlib::GzipWriter.open(t.path) {|gz| gz.print("foobar") } + str = "\u3042\u3044\u3046" + Zlib::GzipWriter.open(t.path) {|gz| gz.print(str) } - f = Zlib::GzipReader.open(t.path) + f = Zlib::GzipReader.open(t.path, encoding: "UTF-8") assert_raise(ArgumentError) { f.read(-1) } + assert_equal(str, f.read) end def test_readpartial |