@@ -602,7 +602,7 @@ namespace rubinius {
602
602
native_int String::char_size (STATE) {
603
603
if (num_chars_->nil_p ()) {
604
604
OnigEncodingType* enc = encoding (state)->get_encoding ();
605
- if (byte_compatible_p (encoding_) || CBOOL (ascii_only_ )) {
605
+ if (byte_compatible_p (encoding_) || CBOOL (ascii_only_p (state) )) {
606
606
num_chars (state, num_bytes_);
607
607
} else if (fixed_width_p (encoding_)) {
608
608
num_chars (state, Fixnum::from ((byte_size () + ONIGENC_MBC_MINLEN (enc) - 1 ) / ONIGENC_MBC_MINLEN (enc)));
@@ -1337,7 +1337,7 @@ namespace rubinius {
1337
1337
if (i >= byte_size () || i < 0 ) return cNil;
1338
1338
1339
1339
native_int len = char_size (state);
1340
- if (byte_compatible_p (encoding_) || CBOOL (ascii_only_ )) {
1340
+ if (byte_compatible_p (encoding_) || CBOOL (ascii_only_p (state) )) {
1341
1341
return byte_substring (state, i, 1 );
1342
1342
} else {
1343
1343
// Assumptions above about size are possibly invalid, recalculate.
@@ -1355,7 +1355,7 @@ namespace rubinius {
1355
1355
native_int String::find_character_byte_index (STATE, native_int index,
1356
1356
native_int start) {
1357
1357
OnigEncodingType* enc = encoding (state)->get_encoding ();
1358
- if (byte_compatible_p (encoding_) || CBOOL (ascii_only_ )) {
1358
+ if (byte_compatible_p (encoding_) || CBOOL (ascii_only_p (state) )) {
1359
1359
return start + index ;
1360
1360
} else if (fixed_width_p (encoding_)) {
1361
1361
return start + index * ONIGENC_MBC_MINLEN (enc);
@@ -1391,7 +1391,7 @@ namespace rubinius {
1391
1391
native_int String::find_byte_character_index (STATE, native_int index,
1392
1392
native_int start) {
1393
1393
OnigEncodingType* enc = encoding (state)->get_encoding ();
1394
- if (byte_compatible_p (encoding_) || CBOOL (ascii_only_ )) {
1394
+ if (byte_compatible_p (encoding_) || CBOOL (ascii_only_p (state) )) {
1395
1395
return index ;
1396
1396
} else if (fixed_width_p (encoding_)) {
1397
1397
return index / ONIGENC_MBC_MINLEN (enc);
@@ -1500,7 +1500,7 @@ namespace rubinius {
1500
1500
n = size - i;
1501
1501
}
1502
1502
1503
- if (n == 0 || byte_compatible_p (encoding_) || CBOOL (ascii_only_ )) {
1503
+ if (n == 0 || byte_compatible_p (encoding_) || CBOOL (ascii_only_p (state) )) {
1504
1504
return byte_substring (state, i, n);
1505
1505
} else {
1506
1506
return char_substring (state, i, n);
@@ -1564,7 +1564,7 @@ namespace rubinius {
1564
1564
uint8_t * s;
1565
1565
uint8_t * ss;
1566
1566
1567
- if (byte_compatible_p (encoding ()) || CBOOL (ascii_only_ )) {
1567
+ if (byte_compatible_p (encoding ()) || CBOOL (ascii_only_p (state) )) {
1568
1568
for (s = p += offset, ss = pp; p < e; s = ++p) {
1569
1569
if (*p != *pp) continue ;
1570
1570
0 commit comments