Remix.run Logo
tyingq 3 days ago

There was a time when TCL could not handle binary data at all. The support came in TCL 8.0:

"Binary data is now supported in Tcl."

https://www.tcl.tk/software/tcltk/relnotes/tcl8.0.txt

Well before 2004, but worth mentioning because you'll find a fair amount of old posts complaining about it.

gcr 3 days ago | parent [-]

What do you mean, that TCL strings weren’t 8-bit-clean?

pavlov 3 days ago | parent [-]

Maybe they were zero-terminated C strings, which of course can’t represent arbitrary binary data.

tyingq 2 days ago | parent [-]

Yes, prior to 8.0, tcl strings mapped to null-terminated C strings.

"Binary I/O. The new object system in Tcl 8.0 supports binary strings (internally, strings are counted in addition to being null terminated). There is a new "binary" command for inserting and extracting data to/from binary strings. Commands such as "puts", "gets", and "read" commands now operate correctly on binary data. There is a new variable tcl_platform(byteOrder) to identify the native byte order for the current host."