If
open
or
with-open-file
gets a complete
:external-format
argument then, it is used as is. For example, this form opens an ASCII linefeed-terminated stream:
(with-open-file (ss "C:/temp/ascii-lf"
:direction :output
:external-format
'(:ascii :eol-style :lf))
(stream-external-format ss))
=>
(:ASCII :EOL-STYLE :LF)
If you know the encoding of a file you are opening, then you should pass the appropriate
:external-format
argument.