in reply to Re: How to set the UTF8 flag?
in thread How to set the UTF8 flag?

100% agree.

From that, we can conclude that is_utf8 is at best a debugging tool for XS modules and Perl itself.

That's not what the OP was doing, so that's not what they should have been using. They should have been inspecting the contents of the string. To inspect the contents of a string without creating new encoding issues, one can use sprintf "%vX".

I'm glad to learn the OP's solution was to use decode and not anything related to the UTF-8 flag.