Replies: 1 comment 1 reply
-
From RFC 8259, section 11:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Looking at this code here:
https://github.com/tokio-rs/axum/blob/main/axum/src/json.rs#L194
It's just doing
application/json
But the JSON spec requires UTF-8 encoding except for "closed systems".
It seems to me that the most common case (not a closed system) will always require UTF-8 encoding for JSON responses. I run into this frequently when using things like emojis in a JSON response and they show up as escape codes instead of emojis because Json(..) does not indicate the charset in the content-type.
Beta Was this translation helpful? Give feedback.
All reactions