3 ms·
By spec all JSON must be UTF-8. Anyone adding encodings to application/json is, at best, redundant.
by jshier 2y ago
By spec all JSON must be UTF-8. Anyone adding encodings to application/json is, at best, redundant.
- rusk 2y agoUTF-8 is variable width my friend
- chubot 2y agoThe fact that JSON is UTF-8 doesn't contradict the fact that it's bytes! That's a feature, not a bug. i.e. "exterior designs are layered" - https://www.oilshell.org/blog/2023/06/ysh-design.html#exterior-designs-are-layered https://www.oilshell.org/blog/2023/06/ysh-design.html#exteri... This is not a trivial point -- there are plenty of specs which are sloppy about text, try to abstract over code points, and result in non-working software. A main example is the shitshow with libc and Unicode - https://thephd.dev/cuneicode-and-the-future-of-text-in-c#standard-c https://thephd.dev/cuneicode-and-the-future-of-text-in-c#sta... It suffers from what I call "interior fictions", like wchar_t.
- rusk 2y agoOf course it’s all bytes. It’s all bytes. That doesn’t change the fact that you need to have some awareness of encoding before those bytes are fully sensible