in reply to Re^7: Rogue character(s) at start of JSON file (BOM; dumping references)
in thread Rogue character(s) at start of JSON file
compare how the behavior changes with open my $fh, '<:encoding(UTF-8)', '../data/publicextract.charity.json' or die "Unable to read Charity JSON File"; compared to the open line you currently use.
I neglected to mention that I had previously read the file as UTF-8 in the way you suggest. But then decode_json complains about "wide characters" which I don't understand.
have your regex instead either search for the three bytes in octal with s/^\357\273\277//
That's the bit I needed!
I was getting thrown by the 0x1c56920 in 0x1c56920 "\357\273\277
That makes perfect sense except I don't understand what 0x1c56920 means in the output from the Devel::Peek Dump function.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: Rogue character(s) at start of JSON file (BOM; dumping references)
by pryrt (Abbot) on Jan 19, 2023 at 20:08 UTC | |
|
Re^9: Rogue character(s) at start of JSON file (BOM; dumping references)
by LanX (Saint) on Jan 19, 2023 at 19:57 UTC | |
by Bod (Parson) on Jan 19, 2023 at 21:11 UTC | |
by LanX (Saint) on Jan 19, 2023 at 22:25 UTC |