The documentation for decode_json says it takes a UTF8 encoded string.
This is the doc:
decode_json$perl_scalar = decode_json $json_textThe opposite of encode_json: expects an UTF-8 (binary) string and tries to parse that as an UTF-8 encoded JSON text, returning the resulting reference. Croaks on error.
(Emphasis mine)
decode_json expects BYTES, not UTF-8 CHARACTERS. Feed it the non-decoded file (i.e. open raw, not with :encoding) and everything shoud work.
Alexander
In reply to Re: Wide characters and UTF8
by afoken
in thread Wide characters and UTF8
by Bod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |