I'm dealing with a file full of UNICODE chars. And clisp chokes over
those. How do I change codepage in clisp?
--
"Now the storm has passed over me
I'm left to drift on a dead calm sea
And watch her forever through the cracks in the beams
Nailed across the doorways of the bedrooms of my dreams"
Nikola Skoric <·········@net4u.hr> writes:
> I'm dealing with a file full of UNICODE chars. And clisp chokes over
> those. How do I change codepage in clisp?
http://clisp.cons.org/impnotes/encoding.html
But I doubt you have UNICODE characters in this file. Characters are
hard to put in files, on unix or other recent OSes. We usually put
bytes there. So we have to encode characters, and unicode characters
are usually encoded in UTF-8, more rarely in UTF-16.
So that'd give:
(with-open-file (stream path :EXTERNAL-FORMAT #+clisp CHARSET:UTF-8
#-clisp (error "I don't know UTF-8 on ~A"
(lisp-implementation-type)))
(read-line stream))
--
__Pascal Bourguignon__ http://www.informatimago.com/
"You question the worthiness of my code? I should kill you where you
stand!"