I have a file which contains characters which read-char is not able to read because their char code is apparently larger than 127.
The content of the file is not in my control. It is a standard format
https://people.sc.fsu.edu/~jburkardt/data/cnf/cnf.html
and apparently in the comments, non-ascii characters are allowed.
So I've opened the file with :element-type 'unsigned-byte.
With this I can read the file byte by byte explicitly ignoring these funny characters.
At some point I read to read an expression which I know does not have a funny character.
I want to call (read stream) to read what I know is an integer.
But cannot call read on a non-character stream.
#<SB-SYS:FD-STREAM for "file /Volumes/Disk2/jimka/sw/common-lisp/regular-type-expression/cl-robdd/data/dtba-sat.cnf" {10040DDF13}> is not a character input stream.
[Condition of type SIMPLE-TYPE-ERROR]
Is there a way for me to set the stream-element-type back to character before calling read?
What is the correct way to do this?