diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-23 19:29:01 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-23 19:29:01 +0000 |
commit | b4f2e2ba074fb8eb689769ca4623eedcc265092c (patch) | |
tree | 8a3ef3b33264ca16fd9ce937f78218f8a97570a1 /io.c | |
parent | b487d9459d6a7c2d64f496b3fc808fab571db2ab (diff) | |
download | ruby-b4f2e2ba074fb8eb689769ca4623eedcc265092c.tar.gz |
* io.c (io_enc_str): should preserve default_external encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; } |