5 Jun 23:43
Text files in MCL 5.2
From: Octav Popescu <octav@...>
Subject: Text files in MCL 5.2
Newsgroups: gmane.lisp.mcl.general
Date: 2008-06-05 21:47:22 GMT
Subject: Text files in MCL 5.2
Newsgroups: gmane.lisp.mcl.general
Date: 2008-06-05 21:47:22 GMT
MCL 5.2 seems to have a problem with text files. It assumes the input
file is encoded in MacRoman and converts it to Unicode strings on
reading, but it doesn't do a reverse conversion on writing. And then it
just writes the lower bytes of the unicode codes. So for instance if you do:
(with-open-file (in "Home:In.lisp")
(with-open-file (out "Home:Out.lisp" :direction :output :if-exists
:supersede)
(princ (read-line in) out)))
And if you have a line with foreign language characters in "In.lisp",
you end up with different characters in "Out.lisp". So if you read it
again, you get a different text than the first time. Does anybody have a
solution for this problem? I found a workaround by calling
ccl::convert-string-to-mac-encodings on the string before writing it,
but I'm hoping for a better integrated solution, which I can save as a
patch.
Thanks,
Octav
_______________________________________________
info-mcl mailing list
info-mcl@...
http://clozure.com/mailman/listinfo/info-mcl
RSS Feed