This addresses some of the field problems caused by commit
1500bd919ffeae0f3252f8d1bb28b03b043d328e, but by no means all.
If the stringification of $^E or $! is done in the scope of 'use bytes',
the UTF-8 flag on the result is now never set. In such scope, the
behavior is then the same as it was prior to that commit. The actual
behavior will change before v5.20 ships.
* potential that we will get it wrong however, especially on short
* error message text. (If it turns out to be necessary, we could
* also keep track if the current LC_MESSAGES locale is UTF-8) */
- if (! is_ascii_string((U8*) SvPVX_const(sv), SvCUR(sv))
+ if (! IN_BYTES /* respect 'use bytes' */
+ && ! is_ascii_string((U8*) SvPVX_const(sv), SvCUR(sv))
&& is_utf8_string((U8*) SvPVX_const(sv), SvCUR(sv)))
{
SvUTF8_on(sv);