From: proton
Subject: Newbie: Displaying Unicode characters in CLISP
Date: 
Message-ID: <1188593692.782433.73100@w3g2000hsg.googlegroups.com>
I am a newbie to CLISP, and I am a bit lost. I am trying
(unsuccessfully ) to display Unicode characters, such as a Greek alpha
on the screen. I have tried the following:

(code-char #x03B1) ==> #\GREEK_SMALL_LETTER_ALPHA, a good start, but
not an alpha character.

If I do:
(format t "~a" (code-char #x03B1)) ==> I get ERROR character #
\03B1..... cannot be represented in the character set CHARSET:CP850

If I change the encoding with:

(setf *terminal-encoding* (make-encoding :charset charset:utf-8))

and try the previous command, now I get something different: two DOS-
style box characters.

I have read in the implementation notes that CLISP must be compiled
with the Unicode option activated. I don't know how to see if this is
the case, but I suspect it is on because of the different behavior
when I change the terminal-encoding (am I right?). So I suspect that I
still need to change some other settings.

Is there any way to display non-ASCII characters?

I am running version 2-41of CLISP in Win2000, with several Unicode
fonts.

Thanks a lot for your help.

From: Pascal Bourguignon
Subject: Re: Newbie: Displaying Unicode characters in CLISP
Date: 
Message-ID: <87fy1ylk9e.fsf@mini.informatimago.com>
proton <··········@gmail.com> writes:

> I am a newbie to CLISP, and I am a bit lost. I am trying
> (unsuccessfully ) to display Unicode characters, such as a Greek alpha
> on the screen. I have tried the following:
>
> (code-char #x03B1) ==> #\GREEK_SMALL_LETTER_ALPHA, a good start, but
> not an alpha character.
>
> If I do:
> (format t "~a" (code-char #x03B1)) ==> I get ERROR character #
> \03B1..... cannot be represented in the character set CHARSET:CP850
>
> If I change the encoding with:
>
> (setf *terminal-encoding* (make-encoding :charset charset:utf-8))
>
> and try the previous command, now I get something different: two DOS-
> style box characters.
>
> I have read in the implementation notes that CLISP must be compiled
> with the Unicode option activated. I don't know how to see if this is
> the case, but I suspect it is on because of the different behavior
> when I change the terminal-encoding (am I right?). So I suspect that I
> still need to change some other settings.


C/USER[5]> (find :unicode *features*)
:UNICODE

(if charset:utf-8 is present, this already means you have unicode).

> Is there any way to display non-ASCII characters?

Yes.  Use a non-ASCII terminal!

On the clisp side, you've done what you needed to do.  But you must
check that your terminal is indeed able to display unicode characters
encoded as utf-8.  Since you get two DOS-style box characters, it
means that clisp correctly sends you the utf-8 code sequence
corresponding to the greek alpha character (which is two-byte long).
But your terminal doesn't interpret this code sequence and displays
these "error" boxes.


> I am running version 2-41of CLISP in Win2000, with several Unicode
> fonts.

A good unicode terminal, IMO, is emacs.


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

COMPONENT EQUIVALENCY NOTICE: The subatomic particles (electrons,
protons, etc.) comprising this product are exactly the same in every
measurable respect as those used in the products of other
manufacturers, and no claim to the contrary may legitimately be
expressed or implied.
From: John Thingstad
Subject: Re: Newbie: Displaying Unicode characters in CLISP
Date: 
Message-ID: <op.txy3jdpzpqzri1@pandora.upc.no>
> If I do:
> (format t "~a" (code-char #x03B1)) ==> I get ERROR character #
> \03B1..... cannot be represented in the character set CHARSET:CP850
>

Your DOS Terminal is set to display CP (code page) 850.
This is iso-latin-1 and some extraes
Look at this to get a idea..
http://www.i18nguy.com/unicode/codepages.html