in reply to Wide characters and UTF8
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Wide characters and UTF8
by Bod (Parson) on Nov 08, 2023 at 17:50 UTC | |
by NERDVANA (Priest) on Nov 08, 2023 at 19:31 UTC | |
by Corion (Patriarch) on Nov 08, 2023 at 17:53 UTC |