1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* add ascii incompatible case.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2008-02-22 12:56:21 +00:00
parent bdb14b5bb6
commit 70eea8fd26

View file

@ -220,7 +220,8 @@ rb_enc_cr_str_copy(VALUE dest, VALUE src)
ENC_CODERANGE_SET(dest, ENC_CODERANGE_7BIT);
break;
case ENC_CODERANGE_VALID:
if (search_nonascii(RSTRING_PTR(dest), RSTRING_END(dest)))
if (!rb_enc_asciicompat(enc) ||
search_nonascii(RSTRING_PTR(dest), RSTRING_END(dest)))
ENC_CODERANGE_SET(dest, ENC_CODERANGE_VALID);
else
ENC_CODERANGE_SET(dest, ENC_CODERANGE_7BIT);