- Rows become sequence entries
- Every data row is written as a hyphen-prefixed mapping, with keys taken from the header. Reading the output is much easier than reading the CSV when rows have many columns, since each field appears on its own line with its name.
- Type inference, and why quoting appears
- Numbers and booleans are converted to real YAML types. Values that must stay strings are quoted automatically: "01234" keeps its leading zero and "true" stays a string rather than becoming a boolean. That quoting is what makes the conversion safe to reverse.
- Values with newlines become block scalars
- A quoted CSV field containing a line break is written as a YAML block scalar, so the text stays readable across several lines instead of being crammed into one escaped string.
- Duplicate headers are made unique
- YAML mappings cannot repeat a key, so a duplicated column name is suffixed, two "name" columns become name and name_2, and blank headers become column_1, column_2 by position.