Why YAML Could Turn a Country Code Into a Boolean

YAML is a human-readable format for configuration files and structured data. In older YAML versions, it tried to infer a value’s type from its spelling: words such as `true` and `false` became Boolean values, and YAML 1.1 also treated certain forms of “yes” and “no” as Booleans. That meant the unquoted country code `NO`—Norway’s two-letter code—could be read as false rather than as text.

The ambiguity came from a convenience feature called implicit typing. A person could write a simple word without marking its type, and the parser would decide whether it represented text, a number, or a Boolean. That saved punctuation in ordinary cases, but it made some valid-looking strings dependent on the parser’s rules.

How That Could Break Localization

Internationalization files often organize translated text by language or country code. If a parser converted `NO` into a Boolean, software expecting a text key might not find the Norwegian entry, or could load the data under an unexpected key. The YAML file might still look correct to a person; the mismatch appeared when the application read it.

Quoting the code makes the intended type explicit: `