JSON compatibility and encoding
"Oren Ben-Kiki" <[email protected]>
| Newsgroups | gmane.text.yaml.general |
|---|---|
| Message-ID | <[email protected]> |
I was going through the JSON RFC here http://www.ietf.org/rfc/rfc4627.txtand I noted we have a potential incompatibility with JSON file when it comes to encodings: - JSON allows the use of UTF-32. YAML does not. - JSON's first character is always ASCII, hence it uses null patterns to automatically detect the encoding; YAML requires a BOM for UTF-16. Therefore: - Valid UTF-8 JSON files are also valid YAML files. - Valid UTF-16 JSON files are not valid YAML files because they lack a BOM. - Valid UTF-32 JSON files are not valid YAML files because YAML does not support UTF-32. Alternatives: 1. Leave things they way they are. Document the compatibility restrictions - use UTF-8 for YAML compatibility. 2. Support UTF-32, and make BOM optional. If it is missing assume the 1st character is ASCII so it use the same null-pattern detection as JSON. Opinions, ideas, comments? ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Yaml-core mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/yaml-core