Closed quackenbush closed 2 years ago
I'll take a look. If the unicode can be preserved I'll do that but failing that maybe leave it off.
Fixed in branch bug/unicode-in-error. Please give it a try and then I'll release. It was easier to fix than expected.
Thanks Peter for the quick fix.
Confirmed:
*-*-* unexpected character '→' at 1:1
Looks like the "escape" code path needs the same fix:
$ echo '"\→"' | ./main
*-*-* invalid JSON escape character '\â' at 1:3
Considered that but chose wrong. On it.
Ok, pushed that change too.
Yep, looks good.
Released
When encountering errors at multi-byte/unicode tokens, the ojg parser reports an error message with the wrong character.
I'd like to either display the correct unicode character, or omit it:
Note: this same bug shows up in the "encoding/json" library and in Firefox JS, but is correct in Chrome JS.
Here is Chrome's error message: