[r6rs-discuss] Stateful codecs and inefficient transcoding

From: Per Bothner <per>
Date: Tue Oct 31 01:37:32 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
the encoding.
-- 
	--Per Bothner
per_at_bothner.com   http://per.bothner.com/
Received on Tue Oct 31 2006 - 01:38:01 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC