From 06d87bfeac364cc77f3ef09a477aa12957a51f0f Mon Sep 17 00:00:00 2001 From: matz Date: Sun, 23 Dec 2007 19:29:01 +0000 Subject: * io.c (io_enc_str): should preserve default_external encoding. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index 3dda55cdc..54bff0ecb 100644 --- a/io.c +++ b/io.c @@ -1316,9 +1316,9 @@ io_enc_str(VALUE str, rb_io_t *fptr) rb_enc_from_encoding(fptr->enc), rb_enc_from_encoding(fptr->enc2)); } - else if (fptr->enc) { + else { /* just one encoding, so associate it with the string */ - rb_enc_associate(str, fptr->enc); + rb_enc_associate(str, io_read_encoding(fptr)); } return str; } -- cgit