5 Jun 2008 23:47
Text files in MCL 5.2
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
Thanks for the reasoning!
>A compiler could theoretically detect that the standard method
>combination is used, and thus anticipate that qualifiers other
>than :before, :after and :around are invalid. However, in the general
>case, method combination can be performed by some user-defined
>algorithm, and thus it is impossible to predict in the general case
>which qualifiers are acceptable or not. This could, for example,
>depend on runtime state of the system.
>
>
>Pascal
>
>--
>Pascal Costanza, mailto:
RSS Feed