From 8db0a59d921144bc73a385d664246f4b8bd2985e Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 21 Oct 2008 14:14:13 +0000 Subject: * ext/stringio/stringio.c (strio_write): should convert writing string to the encoding of the buffer. * hash.c (rb_any_hash): typo fixed. * ext/zlib/zlib.c (rb_gzwriter_write): oops, IO string conversion need to be done by to_s. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/zlib/zlib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ext/zlib') diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index bc0716b83..d2bcf76eb 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -2747,7 +2747,8 @@ rb_gzwriter_write(VALUE obj, VALUE str) { struct gzfile *gz = get_gzfile(obj); - StringValue(str); + if (TYPE(str) != T_STRING) + str = rb_obj_as_string(str); if (gz->enc2 && gz->enc2 != rb_ascii8bit_encoding()) { str = rb_str_conv_enc(str, rb_enc_get(str), gz->enc2); } -- cgit