Real-world SaaS CSV exports break standard parsers in three places before type inference even starts: leading UTF-8 BOM bytes, Windows-1252 bytes in 0x80..0x9F, and embedded \n / \r\n inside quoted cells.
| Stage | Encoding / Framing Rule | Diagnostic Metadata |
|---|---|---|
1. utf-8-sig |
Detects and strips 0xEF 0xBB 0xBF so \ufeffid becomes clean id. |
bom_stripped: true |
2. Strict utf-8 |
Validates clean multi-byte UTF-8 sequences without silent replacement characters. | encoding: "utf-8" |
3. cp1252 fallback |
Preserves 0x80..0x9F (€, “, ”, —, ™) instead of turning them into C1 control bytes. |
encoding_fallback_cp1252 |
4. latin-1 + RFC 4180 |
Lossless byte fallback for undefined CP1252 slots, delimiter sniffing (, ; \t |), and multiline quoted cell parsing. |
encoding_fallback_latin1 |
curl -sS -X POST https://migrate.fastmesh.dev/v1/infer-schema \
-H "Content-Type: application/json" \
-d '{
"source_format": "csv",
"target_format": "sqlite",
"table_name": "dirty_csv_notes",
"source_data": {"content_base64": "77u/aWQsbmFtZSxub3RlcwoxLEFsaWNlknMgQ28sIkxpbmUgMQpMaW5lIDIiCg=="}
}'