▲ | ape4 4 days ago | |||||||||||||||||||||||||||||||||||||||||||
Seems like libraries that serialize to JSON should have an option to filter out these bad characters. | ||||||||||||||||||||||||||||||||||||||||||||
▲ | layer8 4 days ago | parent | next [-] | |||||||||||||||||||||||||||||||||||||||||||
No. As the RFC notes: “Silently deleting an ill-formed part of a string is a known security risk. Responding to that risk, Section 3.2 of [UNICODE] recommends dealing with ill-formed byte sequences by signaling an error or replacing problematic code points, ideally with "�" (U+FFFD, REPLACEMENT CHARACTER).” I would almost always go for “signaling an error”. | ||||||||||||||||||||||||||||||||||||||||||||
▲ | Manfred 4 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||
My experience writing Unicode related libraries is that people don't use features when you have to explain why and when to use them. I assume that's why Tim puts the emphasis on "working on something new". | ||||||||||||||||||||||||||||||||||||||||||||
▲ | CharlesW 4 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||
This RFC and Go-language reference library is designed to be used by existing libraries that do serialization/sanitation/validation. This is hot off the press, so I'm sure Tim would appreciate it if you'd let your favorite library know it exists. | ||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||
▲ | xdennis 4 days ago | parent | prev [-] | |||||||||||||||||||||||||||||||||||||||||||
How is Unicode in any way related to JSON? JSON should just encode whatever dumb data someone wants to transport. Unicode validation/cleanup should be done separately because it's needed in multiple places, not just JSON. | ||||||||||||||||||||||||||||||||||||||||||||
|