зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
f59caa2950
Коммит
65fcaf4113
|
@ -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()
|
||||
|
|
1
string.c
1
string.c
|
@ -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()) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче