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 | |
| parent | f59caa2950d454f651438cccff6298c4e13dc354 (diff) | |
* 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
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | string.c | 1 |
2 files changed, 5 insertions, 0 deletions
@@ -1,3 +1,7 @@ +Thu Mar 15 14:49:31 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * string.c (rb_str_conv_enc_opts): default to original encoding. + Thu Mar 15 13:47:17 2012 NAKAMURA Usaku <usa@ruby-lang.org> * hash.c (env_str_new, rb_f_getenv, env_fetch): use rb_str_conv_enc() @@ -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()) { |
