s = (U8*)SvPV_nomg(sv, len);
if (!SvUTF8(sv)) {
- const U8 *t = s;
- const U8 * const e = s + len;
- while (t < e) {
- const U8 ch = *t++;
- hibit = !NATIVE_BYTE_IS_INVARIANT(ch);
- if (hibit) {
- s = bytes_to_utf8(s, &len);
- break;
- }
+ hibit = ! is_utf8_invariant_string(s, len);
+ if (hibit) {
+ s = bytes_to_utf8(s, &len);
}
}
send = s + len;
s = (const U8*)SvPV_nomg_const(sv, len);
if (!SvUTF8(sv)) {
- const U8 *t = s;
- const U8 * const e = s + len;
- while (t < e) {
- const U8 ch = *t++;
- hibit = !NATIVE_BYTE_IS_INVARIANT(ch);
- if (hibit) {
- start = s = bytes_to_utf8(s, &len);
- break;
- }
+ hibit = ! is_utf8_invariant_string(s, len);
+ if (hibit) {
+ start = s = bytes_to_utf8(s, &len);
}
}
send = s + len;
PERL_ARGS_ASSERT_DO_TRANS_COMPLEX_UTF8;
if (!SvUTF8(sv)) {
- const U8 *t = s;
- const U8 * const e = s + len;
- while (t < e) {
- const U8 ch = *t++;
- hibit = !NATIVE_BYTE_IS_INVARIANT(ch);
- if (hibit) {
- s = bytes_to_utf8(s, &len);
- break;
- }
+ hibit = ! is_utf8_invariant_string(s, len);
+ if (hibit) {
+ s = bytes_to_utf8(s, &len);
}
}
send = s + len;