p4raw-id: //depot/perl@22439
return len;
}
- if (SvUTF8(sv))
- return SvCUR(sv);
-
if (SvIsCOW(sv)) {
sv_force_normal_flags(sv, 0);
}
+ if (SvUTF8(sv))
+ return SvCUR(sv);
+
if (PL_encoding && !(flags & SV_UTF8_NO_ENCODING))
sv_recode_to_utf8(sv, PL_encoding);
else { /* Assume Latin-1/EBCDIC */