Opened 14 years ago
Closed 13 years ago
#42 closed defect (fixed)
read-sequence vs unicode
Reported by: | Raymond Toy | Owned by: | somebody |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Core | Version: | 20b |
Keywords: | Cc: |
Description (last modified by )
Cmucl has been able to use READ-SEQUENCE
to read octets (and other integers types) from character streams. With the introduction of Unicode support, this no longer works correctly in general. The data that is read is not done from the last position, and the data that is read is not necessarily reflected in the next READ-CHAR
. That is, READ-CHAR
might re-read the data that READ-SEQUENCE
already read. (This depends on how much data has been read, and the internal stream buffering.)
However, if the external format is :iso8859-1, then READ-SEQUENCE
behaves as it used to. Hence, as a workaround, the user can set the external format to :iso8859-1 before READ-SEQUENCE
and set it back afterwards. This works as expected.
Perhaps READ-SEQUENCE
should do that itself? (Appropriately wrapping everything in UNWIND-PROTECT
so that the stream external format isn't unexpectedly modified.)
Change History (3)
comment:1 Changed 14 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 14 years ago by
comment:3 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Closing report. It seems to be working as expected---errors are signaled if the stream is of the wrong type, except if the stream is a binary-text-stream
.
The October snapshot should have this mostly fixed. Errors will now be signaled if the stream is of the wrong type, but if the stream is a binary-text-stream,
READ-SEQUENCE
will work as before. This is a change from 20a and 20b, and is also incompatible with 19f and earlier which allowedREAD-SEQUENCE
to work on character streams and binary streams of'(unsigned-byte 8)
.