It doesn't seem to be properly utf8 encoded and as you already said the JSON is malformed because you didn't read it completely.
use v5.12; use warnings; use Devel::Peek; use utf8; my $str = "\x{FEFF}['what','ever']"; $str =~ s/^\x{feff}//; Dump($str);
SV = PV(0xe9cea8) at 0x24f1008 REFCNT = 1 FLAGS = (POK,pPOK,UTF8) PV = 0x2565b28 "['what','ever']"\0 [UTF8 "['what','ever']"] CUR = 15 LEN = 24
so you should take care to read the data properly.
Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery
In reply to Re^5: Rogue character(s) at start of JSON file (BOM; dumping references)
by LanX
in thread Rogue character(s) at start of JSON file
by Bod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |