Subject: [clisp-list] CHARSET questions

From: "John K. Hinsdale" <[email-masked]>
Date: Fri Aug 9 10:17:03 2002

I'm testing a module to store & retreive from Oracle to CLISP and I'm
getting an error when strings are converted from the "C" form
(null-terminated) to internal CLISP strings:

	*** - invalid byte #x94 in CHARSET:ASCII conversion

This is only happening for bytes in the range 0x80 to 0xFF (i.e.,
above the 7-bit ASCII range.  Any ideas?  I looked at the docs and it
wasn't obvious to me how to change the charset from ASCII to some
8-bit one (or even how to inquire as to what the current charset is)

What's weird is I don't have this problem on another machine that also
runs CLISP.  The machines each run Linux (Debian) but one (the one
that works) is a later version of Debian ("woody" vs. "potato").  But
that doesn't seem like it should matter, and more important, the one
that gives the error is my main devel. box.

Do I need to install some local-specific thing?  Or is there some way
to tell CLISP not to try to convert to ASCII?  Or maybe I shouldn't be
using some internal Lisp object than other than string to retrieve the
data?  I'm using the FFI::c-string type.

Any advice would be appreciated.

[My Oracle library is looking pretty good, just needs some more
testing and I'm looking forward to making it available to the CLISP
user base under the GPL.]

---
John Hinsdale, Alma Mater Software, Inc., Tarrytown, NY 10591-3710 USA
[email-masked] | http://www.alma.com/staff/hin | +1 914 631 4690

---

From: Sam Steingold <[email-masked]>
Date: Fri Aug 9 10:57:02 2002

> * In message <[email-masked]>
> * On the subject of "[clisp-list] CHARSET questions"
> * Sent on Fri, 9 Aug 2002 13:16:21 -0400
> * Honorable "John K. Hinsdale" <[email-masked]> writes:
>

<http://www.gnu.org/software/clisp/faq.html#enc-err>

> user base under the GPL.]

cool!

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat7.3 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
MS Windows: error: the operation completed successfully.

---

From: Kaz Kylheku <[email-masked]>
Date: Fri Aug 9 16:05:04 2002

On Fri, 9 Aug 2002, John K. Hinsdale wrote:

> Date: Fri, 9 Aug 2002 13:16:21 -0400
> From: John K. Hinsdale <[email-masked]>
> To: [email-masked]
> Subject: [clisp-list] CHARSET questions
> 
> 
> above the 7-bit ASCII range.  Any ideas?

This is controlled by the variable *default-file-encoding*, which
is initialized based on your LANG environment variable.

>I looked at the docs and it

Change your LANG environment variable, or do something like

    (setf *default-file-encoding* charset:iso-8859-1)

I think that this variable is actually a symbol macro, not a special
variable. It expands to a function call. So you can't give it a dynamic
binding.

-- 
Meta-CVS: solid version control tool with directory structure versioning. 
http://users.footprints.net/~kaz/mcvs.html  http://freshmeat.net/projects/mcvs

---

From: "John K. Hinsdale" <[email-masked]>
Date: Sat Aug 10 06:39:04 2002

> From: Sam Steingold <[email-masked]>

 > From: Kaz Kylheku <[email-masked]>

Thanks, my $LANG was munged.  Looks like my CLISP defaults to ASCII if
LANG is unset, but also if LANG is set to garbage (?).

It turns out you can ask Oracle what character set is in force in the
current database so I guess I put in a check to see if CLISP is using
ASCII while Oracle is using an 8-bit character set.  Then the problem
can be detected in advance, giving the hints you mentioned.

Thanks ...

---