[info-mcl] Text files in MCL 5.2
Toomas.Altosaar at hut.fi
Thu Jun 5 17:43:33 CDT 2008
IIRC, MCL 5.2 reads in text files and converts to Unicode on the fly.
And if you save the file then there is no going back to using that
file in an earlier MCL release.
Not the solution you are looking for, but I am still using 5.1 for
just that reason.
Is there some switch that allows the Unicode conversion to be turned off?
>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
> (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
>info-mcl mailing list
>info-mcl at clozure.com
More information about the info-mcl