diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-15 05:49:34 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-15 05:49:34 +0000 |
commit | 65fcaf4113e5e9855e98c3f483f34e1bfe077203 (patch) | |
tree | 6c54410e8d9e9829dde7014dc58faea2d5248990 /string.c | |
parent | f59caa2950d454f651438cccff6298c4e13dc354 (diff) | |
download | ruby-65fcaf4113e5e9855e98c3f483f34e1bfe077203.tar.gz |
* string.c (rb_str_conv_enc_opts): default to original encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -483,6 +483,7 @@ rb_str_conv_enc_opts(VALUE str, rb_encoding *from, rb_encoding *to, int ecflags, unsigned char *dp; if (!to) return str; + if (!from) from = rb_enc_get(str); if (from == to) return str; if ((rb_enc_asciicompat(to) && ENC_CODERANGE(str) == ENC_CODERANGE_7BIT) || to == rb_ascii8bit_encoding()) { |