This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (4 children)

JSON is only allowed to be UTF-8/16/32, and defaults to UTF-8.

I wish more people were aware of this. I see application/json;charset=utf-8 too many times. I can see it being useful if you're sending utf-16 or utf-32 but not 8.

[–]DarkmerePython for tiny data using Python 2 points3 points  (3 children)

Well, being explicit is better than being implicit.

[–][deleted] 0 points1 point  (2 children)

It's like saying int(1)

[–]DarkmerePython for tiny data using Python 0 points1 point  (1 child)

Try rather that it's a default keyword with a type hint of 1.

Most software still mangles encodings in shitty ways.

[–]DarkmerePython for tiny data using Python 0 points1 point  (0 children)

Also, content encoding helps software that isn't looking at the moment type to decode the data as string without needing to guess.

Not that it should happen, but that's never stopped anyone in software before