From: Miroslaw Osys
Subject: CLISP charsets
Date: 
Message-ID: <bf1tgg$hm7$1@zeus.polsl.gliwice.pl>
Hi everyone!

I wrote a program which do processing of text file.
But when input is "ISO Latin 2" I get error
    invalid byte #xF3 in CHARSET:ASCII conversion

I read impnotes for CLISP and found 
    ENV:ENCODING
and 
    CHARSET:ISO-8859-2 
objects but description is hard to understand for me.

Anybody can help with this?

Regards

Miroslaw Osys

From: Eric Marsden
Subject: Re: CLISP charsets
Date: 
Message-ID: <wziel0qx3id.fsf@melbourne.laas.fr>
>>>>> "mo" == Miroslaw Osys <ยทยทยทยท@zeus.polsl.gliwice.pl> writes:

  mo> I wrote a program which do processing of text file.
  mo> But when input is "ISO Latin 2" I get error
  mo> invalid byte #xF3 in CHARSET:ASCII conversion
  mo> 
  mo> I read impnotes for CLISP and found 
  mo> ENV:ENCODING
  mo> and 
  mo> CHARSET:ISO-8859-2 
  mo> objects but description is hard to understand for me.

in a CLISP compiled with Unicode support, there are several ways of
specifying the character set used for file I/O:

   * specify the encoding explicitly, on a per-file basis, using
     the :external-format argument to OPEN.

     (with-open-file (f "foo.txt"
                      :direction :input
                      :external-format (ext:make-encoding
                                        :charset "ISO-8859-2"
                                        :line-terminator :unix))
         ...)


   * set CUSTOM:*DEFAULT-FILE-ENCODING*, which affects all file I/O.
     You can do this either from your CLISP initialization file, or
     using the -Efile commandline option, or by setting your
     locale-related environment variables. 
  
   ,---- ~/.clisprc.lsp ---
   | #+unicode
   | (setf custom:*default-file-encoding*
   |       (ext:make-encoding :charset "ISO-8859-2" :line-terminator :unix))
   `----

   % clisp -Efile ISO-8869-2

   % LC_ALL=fr_FR.UTF-8 clisp 
     (this requires your system to have the locale set up correctly)


      <URL:http://clisp.cons.org/impnotes/encoding.html>
      <URL:http://clisp.cons.org/impnotes/clisp.html#opt-enc>

-- 
Eric Marsden                          <URL:http://www.laas.fr/~emarsden/>
From: Miroslaw Osys
Subject: Re: CLISP charsets
Date: 
Message-ID: <bf5t67$q5s$1@zeus.polsl.gliwice.pl>
Thank you very much, Eric.
I try it soon.

Miroslaw Osys