I was going through the JSON RFC here http://www.ietf.org/rfc/rfc4627.txt and 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.
- 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.
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?