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

* fix for (rb_enc_get_index(obj) == idx) case.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2008-05-20 22:50:01 +00:00
parent 102f94455c
commit 19337db497

View file

@ -569,7 +569,7 @@ rb_enc_associate_index(VALUE obj, int idx)
{
/* enc_check_capable(obj);*/
if (rb_enc_get_index(obj) == idx)
return;
return obj;
if (!ENC_CODERANGE_ASCIIONLY(obj) ||
!rb_enc_asciicompat(rb_enc_from_index(idx))) {
ENC_CODERANGE_CLEAR(obj);