Remix.run Logo
pavlov 3 days ago

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."