U32 pm_flags = 0;
const I32 osize = PL_regsize;
- if (DO_UTF8(ret)) {
- assert (SvUTF8(ret));
- } else if (SvUTF8(ret)) {
- /* Not doing UTF-8, despite what the SV says. Is
- this only if we're trapped in use 'bytes'? */
- /* Make a copy of the octet sequence, but without
- the flag on, as the compiler now honours the
- SvUTF8 flag on ret. */
+ if (SvUTF8(ret) && IN_BYTES) {
+ /* In use 'bytes': make a copy of the octet
+ * sequence, but without the flag on */
STRLEN len;
const char *const p = SvPV(ret, len);
ret = newSVpvn_flags(p, len, SVs_TEMP);