Re:Show HN: Faster UTF-8 validator
by nitwit005 on Tuesday November 19, 2019 @10:58PM
(#21580973)
Sure, you can validate and then parse the JSON, but parsing it is also effectively validating it as UTF-8, except for the string values in the JSON, so it's heavily going to be duplicated effort. And unfortunately, the strings can contain things like invalid surrogate pairs by using unicode escapes, so you may want to validate after escaping.
You can't normally blindly parse XML as UTF-8. The encoding has rules for detecting the character set.
You can't normally blindly parse XML as UTF-8. The encoding has rules for detecting the character set.