Skip to content
New issue

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

Possibility to turn off *all* escaping? #514

Open
karalabe opened this issue Jun 27, 2024 · 0 comments
Open

Possibility to turn off *all* escaping? #514

karalabe opened this issue Jun 27, 2024 · 0 comments

Comments

@karalabe
Copy link

I've hit this limitation with the Go stdlib and the new json/v2 they proposed too, and it seems to be in this library too. Specifically, that every user type is forced through an ASCII/HTML escaper. Whilst the latter can be disabled, AFAIK the former cannot.

We have an API where we hex encode some big blobs (10-20MB) via a custom MarshalJSON method, but due to all the json libs forcing an escape run over the produced hex string, the latency shoots up quite a bit (50-100ms), which is too high for us. Wondering if there could be a way to signal to the encoder from a type that "I know my output is correct, append it verbatim and don't do escaping"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant