Is there any safe way of mixing binary with text data in a (pseudo)csv file?
One naive and partial solution would be:
- using a compound field separator, made of more than one character (e.g. the
\a\bsequence for example) - saving each field as either text or as binary data would require the parser of the pseudocsv to look for the
\a\bsequence and read the data between separators according to a known rule (e.g. by the means of a known header with field name and field type, for example)
The core issue is that binary data is not guaranteed to not contain the \a\b sequence somewhere inside its body, before the actual end of the data.
The proper solution would be to save the individual blob fields in their own separate physical files and only include the filenames in a .csv, but this is not acceptable in this scenario.
Is there any proper and safe solution, either already implemented or applicable given these restrictions?