Re: About character set inconsistency

Thomas Russ <[email protected]> Mon, 12 Apr 2010 11:02:52 -0700
Newsgroups gmane.lisp.mcl.general
Message-ID <[email protected]>
On Apr 12, 2010, at 9:37 AM, Sandro Pedrazzini wrote:

> Hi all,
>
> I am using RMCL 5.2.1 on Mac Intel (Leopard)
> I have a character set inconsistency between output to file and input
> from file. I wonder if I am doing some wrong assumptions, or I just
> need to set some flags.

Not really a solution, but a set of directions to investigate:

It seems that the stream code for RMCL has some additional parameters  
that may have an impact on some of this.

One of them is :EXTERNAL-FORMAT, which in my short glance through the  
code seems to be overloaded for doing both encoding types of things  
and file type information.

There is also an :INPUT-FILE-SCRIPT which I couldn't really figure  
out, other than that the default value seems to be one of the Mac OS  
constants, $kcfstringencodingmacroman (=0) which would seem to  
indicate macroman encoding.  Oddly there doesn't seem to be a  
symmetrical output side item, only :OUTPUT-FILE-SCRIPT-P.

The constants for input script seem to be defined in  
ccl:interfaces;CFString.lisp where one can find one for Latin-1  
$kCFStringEncodingISOLatin1 (=513)

So, I would try reading in the file with

   (with-open-file (infile "characters.out" :input-file-script # 
$kCFStringEncodingISOLatin1)
      (let ((char-sequence (read infile)))
        (format nil "~s" (content char-sequence)))

and see if that solves your particular problem.  I'm not sure how to  
assure this on the output side, though.


_______________________________________________
info-mcl mailing list
[email protected]
http://clozure.com/mailman/listinfo/info-mcl