PaulJuliusMartinez / jless

jless is a command-line JSON viewer designed for reading, exploring, and searching through JSON data.
https://jless.io
MIT License
4.73k stars 91 forks source link

UTF-8 (with BOM) not supported #114

Open AdrianVollmer opened 1 year ago

AdrianVollmer commented 1 year ago

I love this tool. Many thanks!

I also have a feature request.

When trying to open a JSON document encoded in UTF-8 (with BOM), jless throws an error:

$ echo efbbbf7b7d0a | xxd -r -p | jless
Unable to parse input: "Parse error"

Unfortunately, UTF-8 (with BOM) exists, and getting all programs that produce it to stop is like fighting against wind mills. It's a source of constant frustration because the BOM is often invisible, until it's not. So if jless started supporting UTF-8 (with BOM), I'd much appreciate it. Or at least produce a better error message that it's an encoding issue instead of a formatting issue, like "not a valid UTF-8 file" or something like that.