in reply to Re^6: Rogue character(s) at start of JSON file (BOM; dumping references)
in thread Rogue character(s) at start of JSON file

Perl has two ways to represent strings, \x{FEFF} represents the unicode character with the code-point #FEFF, since Devel::Peek shows that the flag is missing, this character can't be found in the octet stream while replacing.

You need to tell Perl how to interpret the read data, the fact that it's "bytewise utf-8" alone doesn't help to see it as list of characters.

The use utf8; in my example just told Perl to read the script's source and all embedded literal strings as utf8.

see Encode for more.

Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery

°) which is almost UTF-8, hence the flag is - for historical reasons - a bit of a misnomer