diff options
| author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-28 16:11:37 +0000 |
|---|---|---|
| committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-28 16:11:37 +0000 |
| commit | 4167a04b69717d8d135872a8e68e6e49127695ce (patch) | |
| tree | cfc4c39f3e481e7199d16e02afb8613e4b760264 /test | |
| parent | 79ec15d4295e0807ae2eb42e1fcd097ba1a2664a (diff) | |
merges r24704 from trunk into ruby_1_9_1.
--
* 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/branches/ruby_1_9_1@25548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
| -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 9e4cf8003..630172077 100644 --- a/test/zlib/test_zlib.rb +++ b/test/zlib/test_zlib.rb @@ -442,10 +442,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 |
