> On 23 Mar 2026, at 09:19, Hans Hagen via ntg-context <[email protected]> 
> wrote:
> 
> On 3/23/2026 1:05 AM, Bruce Horrocks wrote:
>>> On 22 Mar 2026, at 18:11, luigi scarso <[email protected]> wrote:
>>> 
>>> 
>>> While other "acronyms" seem reasonable, in
>>> JSON, XML und CSV als Datenformate,
>>> CSV should be deprecated. I understand that many use CSV and that, if 
>>> implemented correctly, it doesn't cause problems,
>>> but it's precisely the "correct" implementation that has become difficult 
>>> to find.
>> CSV is a standard - RFC4180 - and therefore should not be deprecated.
>>> I would propose the ucsv format, Unicode Controls Separated Values,
>>> where fields are separated by 001F (insteead of ',')  and records by 001E 
>>> (instead of newline)
>>> or alternatively 241F and 241E. These characters should not appear in the 
>>> text, to make the parser very simple.
>> The CSV standard is a truly awful one in that it encodes common and 
>> historical practice rather than starting with a clean set of requirements, 
>> so I'm definitely in favour of *adding* ASCII/Unicode 21-31 (FS, GS, RS & 
>> US) as a separately supported type.
> 
> and
> 
> 0x2 : START OF TEXT
> 0x3 : END OF TEXT

Start of text (STX) is/was used for Telex type transmissions to teleprinters. 
SOH indicates the start of header which has routing information, then STX 
indicates the start of the actual message with ETX (End of Text) marking the 
end of the message.

For quotes, newlines etc you only need worry about US (Unit Separator) [1] as 
anything greater than ASCII/UNICODE 32 is part of the unit's (i.e. field's) 
value, and US is not a valid character for inclusion in a field so there is no 
need to escape it.

[1] Note FS, GS & RS can also terminate a unit so you do have to worry about 
those a bit!

> 
> instead of quotes (which we happen to support in luametatex's mplib variant 
> so that embedded quotes and newlines work fine)
> 
>>   $ sqlite3 -header -csv my_db.db "select * from my_table;" > out.csv
> 
> hm, i need to test that
> 
> Hans

I cut and pasted that from a Stack Overflow answer - now I look at it again I 
think the quotes will be wrong, on Unix at least, because the asterisk will be 
expanded by the shell.

  $ sqlite3 -header -csv my_db.db 'select * from my_table;' > out.csv

would be safer.

Regards,
—
Bruce Horrocks
Hampshire, UK

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to