[info-mcl] Text files in MCL 5.2
Octav Popescu
octav at cmu.edu
Thu Jun 5 16:47:22 CDT 2008
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
More information about the info-mcl
mailing list