[r6rs-discuss] Stateful codecs and inefficient transcoding
per at bothner.com
Tue Oct 31 01:38:01 EST 2006
William D Clinger wrote:
>> Binary streams and text streams are distinguished.
> That is a common design choice, but it is a limiting
> choice. There are several important file formats,
> e.g. MPEG, that contain both binary and textual data.
But these aren't hybrid binary/text files; they're
binary files that contain strings.
> Furthermore I am told that some important file formats,
> e.g. XML, use several different textual encodings.
Not quite. Some file formats, including XML, start out with
an encoding declaration. So *if* they're written in encoding that
is a superset of Ascii, then a parser can start out in binary
mode, reading Ascii, and switch to the specified encoding after
having seen the declaration. Alternatively, one could start over
again after parsing the encoding declaration. But you never
switch from one textual encoding to another. XML is a texual
file format; it just supports mechanisms for auto-detecting
per at bothner.com http://per.bothner.com/
More information about the r6rs-discuss