You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
I fed the JSON decoder a document with a non-ASCII Unicode character outside of a string; as this character is not one of the {}[],:"e+-/0-9/whitespace characters that may exist outside of a string in a JSON document, I expect it to complain about that Unicode character.
I expected to see the error invalid character '😀' looking for beginning of value, or perhaps invalid character '\xf0' looking for beginning of value.
What did you see instead?
I got the error invalid character 'ð' looking for beginning of value. This is a nonsense error, as the character ð is not present in the input. Note that the UTF-8 encoding of 😀 is []byte{0xf0, 0x9f, 0x98} and that ð is U+00F0; the first byte of the UTF-8-encoded character is being taken as a complete unencoded rune.
The text was updated successfully, but these errors were encountered:
I'm OK with closing it because @dsnet says he's working on a rewrite that will fix a bunch of issues like this. But I do believe that this has a different root cause than #58680; that if #58680 were getting a targeted bugfix that this would be worth keeping open as a separate bug.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I fed the JSON decoder a document with a non-ASCII Unicode character outside of a string; as this character is not one of the
{}[],:"e+-
/0-9
/whitespace characters that may exist outside of a string in a JSON document, I expect it to complain about that Unicode character.https://go.dev/play/p/joi025GTvFM
What did you expect to see?
I expected to see the error
invalid character '😀' looking for beginning of value
, or perhapsinvalid character '\xf0' looking for beginning of value
.What did you see instead?
I got the error
invalid character 'ð' looking for beginning of value
. This is a nonsense error, as the characterð
is not present in the input. Note that the UTF-8 encoding of😀
is[]byte{0xf0, 0x9f, 0x98}
and thatð
is U+00F0; the first byte of the UTF-8-encoded character is being taken as a complete unencoded rune.The text was updated successfully, but these errors were encountered: