[r6rs-discuss] [Formal] Improve port i/o.

Michael Sperber sperber at informatik.uni-tuebingen.de
Wed Nov 22 13:36:57 EST 2006


John Cowan <cowan at ccil.org> writes:

> Michael Sperber scripsit:
>
>> Any number of files contain both text and binary data---most image
>> file formats, mp3 files, etc.  Moreover, one way to view looking at an
>> XML file would be:
>> 
>> - Start off in binary, identifying whether it's UTF-16, UTF-32 or one
>>   of the 8-bit encodings.
>> 
>> - Switch to ASCII in the latter case for reading the encoding tag.
>> 
>> - Switch to the correct encoding afterwards.
>
> As I pointed out earlier, you don't want to switch to ASCII, because
> not all 8-bit encodings are ASCII-compatible (EBCDIC is not).
> See http://recycledknowledge.blogspot.com/2005/07/hello-i-am-xml-encoding-sniffer.html

Urks.  But the point still stands, right?  I read to the point where
there's a textual encoding (determining *that* encoding) of the actual
encoding, and then switch to that.

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla



More information about the r6rs-discuss mailing list