From 42a6550027acfae936ba4038ca3b2a3e5ed479b2 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 21 Oct 2008 12:56:48 +0000 Subject: * ext/zlib/zlib.c (rb_gzwriter_write): conversion should be done using to_str, not to_s. * ext/zlib/zlib.c (rb_gzwriter_write): need proper conversion according to gz encoding. * ext/zlib/zlib.c (rb_gzreader_ungetc): convert string encoding before unget. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/zlib/test_zlib.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/zlib') diff --git a/test/zlib/test_zlib.rb b/test/zlib/test_zlib.rb index 5746f036ea..5a4a87a0fb 100644 --- a/test/zlib/test_zlib.rb +++ b/test/zlib/test_zlib.rb @@ -597,7 +597,7 @@ if defined? Zlib assert_equal("foo", Zlib::GzipReader.open(t.path) {|gz| gz.read }) o = Object.new - def o.to_s; "bar"; end + def o.to_str; "bar"; end Zlib::GzipWriter.open(t.path) {|gz| gz.print(o) } assert_equal("bar", Zlib::GzipReader.open(t.path) {|gz| gz.read }) end -- cgit v1.2.3