We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version:github.com/json-iterator/go v1.1.12
A json like below be panic when unmarshal with BinaryAsStringExtension
{ "F": "{\"abc\":\"123\"}" }
package main import ( j "github.com/json-iterator/go" je "github.com/json-iterator/go/extra" ) type D struct { F []byte `json:"F"` } func main() { a := "{\"F\":\"{\\\"abc\\\":\\\"123\\\"}\"}" j.RegisterExtension(&je.BinaryAsStringExtension{}) b := new(D) j.Unmarshal([]byte(a), b) }
The text was updated successfully, but these errors were encountered:
According to the source code, all unsafe UTF-8 character will be hexed.
You can try with:
a := "{\"F\":\"{\\\\x22abc\\\\x22:\\\\x22123\\\\x22}\"}"
However, I think this extension could be just an example (my POV: it is not very production-ready)
Sorry, something went wrong.
No branches or pull requests
Version:github.com/json-iterator/go v1.1.12
A json like below be panic when unmarshal with BinaryAsStringExtension
The text was updated successfully, but these errors were encountered: