* encoding.c (rb_enc_associate_index): doesn't clear coderange
when new encoding equals to old one. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
492f431a46
commit
1e0958098f
@ -1,3 +1,8 @@
|
|||||||
|
Wed Feb 20 19:42:03 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* encoding.c (rb_enc_associate_index): doesn't clear coderange
|
||||||
|
when new encoding equals to old one.
|
||||||
|
|
||||||
Wed Feb 20 19:15:38 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
Wed Feb 20 19:15:38 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* string.c (rb_enc_str_copy): added for wrapper for rb_enc_copy.
|
* string.c (rb_enc_str_copy): added for wrapper for rb_enc_copy.
|
||||||
|
@ -613,6 +613,8 @@ void
|
|||||||
rb_enc_associate_index(VALUE obj, int idx)
|
rb_enc_associate_index(VALUE obj, int idx)
|
||||||
{
|
{
|
||||||
enc_check_capable(obj);
|
enc_check_capable(obj);
|
||||||
|
if (rb_enc_get_index(obj) == idx)
|
||||||
|
return;
|
||||||
if (!ENC_CODERANGE_ASCIIONLY(obj) ||
|
if (!ENC_CODERANGE_ASCIIONLY(obj) ||
|
||||||
!rb_enc_asciicompat(rb_enc_from_index(idx))) {
|
!rb_enc_asciicompat(rb_enc_from_index(idx))) {
|
||||||
ENC_CODERANGE_CLEAR(obj);
|
ENC_CODERANGE_CLEAR(obj);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user