3 ms·
Both JSON encoding and decoding require UTF-8 validation. If there's a workload that makes sense to optimize because it's used in production, it's UTF-8 valida
by ncruces 3y ago
Both JSON encoding and decoding require UTF-8 validation.
If there's a workload that makes sense to optimize because it's used in production, it's UTF-8 validation.
So why are we even arguing whether UTF-8 validation is necessary/useful in the "hot path" or in "production"?
- Dylan16807 3y agoSo you asked what I thought, but I never gave an opinion on UTF-8, I gave a generic hypothetical. If you're asking about OP's idea, then I agree that validating the UTF-8 inside of JSON is needed sometimes, though it's not required in all situations. But I wasn't commenting on that, I was commenting on the specific objection of "how do you know if you don't check?", because I don't think that specific objection is very strong.