Subject: [clisp-list] Re[4]: Need help to use Chinese Character..

From: Arseny Slobodjuck <[email-masked]>
Date: Thu Sep 26 01:57:02 2002

Hi,

Thursday, September 26, 2002, 5:23:39 PM, you wrote:

> @echo off
> "H:\clisp-2.29\lisp.exe" -B "H:/clisp-2.29/" -M "H:\clisp-2.29\lispinit.mem" -L 950 %1 %2 %3 %4 %5 %6 %7 %8 %9 
> then type 
[1]>> *terminal-encoding*
> #<ENCODING "CP950" :DOS>
I think -L is for clisp interface selection (error messages etc) on
systems with gettext. Doesn't work in windows (should work in cygwin
version, but I was unable to get it working yet). So that encoding is
correctly got from OS.

> but when I use  -Eterminal
> @echo off
> "H:\clisp-2.29\lisp.exe" -B "H:/clisp-2.29/" -M "H:\clisp-2.29\lispinit.mem" -Etermianl 950 %1 %2 %3 %4 %5 %6 %7 %8 %9 
[1]>> *terminal-encoding*
> #<ENCODING CHARSET:ISO-8859-1 :DOS> 
Two mistakes: a typo in "-Etermianl" and codepages like this should be
prepended with CP, i.e. "-Eterminal CP950".

> It seems 2.29 know 950 codpage now.
> But when I use Chinese Characters in setf or quote
> (setf x 'CHINESECHARS)  here CHINESECHARS are Chinese characters.
> The test.jpg is the result.
Ok, maybe there is an error in clisp, I'll try to check. Error doesn't
happen with Russian characters.

-- 
Best regards,
 Arseny

---

From: Arseny Slobodjuck <[email-masked]>
Date: Thu Sep 26 04:03:02 2002

Hi,

> happen with Russian characters.
Well, seems that there is no simple solution - CP950 have two-byte
characters as well as one-byte ASCII ones.

I can suppose that statement that cause problem is

  var int result = read(handle,&b,1); # try to read a byte

in stream.d [4549] and XP throws an error when there is twobyte
character in buffer. Is there any specialists in the field ?

-- 
Best regards,
 Arseny

---

From: "Wsj" <[email-masked]>
Date: Sun Sep 29 19:42:01 2002

>character in buffer. Is there any specialists in the field ?
  I have some guess....
  1. Is the error due to b's size ?
  2. Could you insert another result=read(handle,&c,1);  when result <0, where c's size is two bytes ?

 Sincerely,
 Wsj

---

From: Arseny Slobodjuck <[email-masked]>
Date: Mon Sep 30 05:34:14 2002

Hello Wsj,

>   2. Could you insert another result=read(handle,&c,1);  when result <0, where c's size is two bytes ?
It's all not so simple.
You may help with following - please send me a _binary_ file (mail
program shouldn't think it's a text file, so don't name it *.txt)
with a word or two in CP950 which cause problem. I'll play with it.
I don't promise anything although.

-- 
Best regards,
 Arseny

---

From: "Wsj" <[email-masked]>
Date: Mon Sep 30 18:29:02 2002

Dear Arseny,
   Here are the CP950 files
   1.bin   : one Chinese Character 
   2.bin  :  two Chinese Characters
   
  Sincerely,
  Wsj