P. Taine
6/7/2015 4:03:00 PM
On Sun, 07 Jun 2015 02:38:58 +0200, "Pascal J. Bourguignon"
<pjb@informatimago.com> wrote:
>P. Taine <user@domaine.invalid> writes:
>
>> On Sun, 07 Jun 2015 00:41:35 +0200, "Pascal J. Bourguignon"
>> <pjb@informatimago.com> wrote:
>>
>>>You are missing the :EXTERNAL-FORMAT parameter of OPEN, WITH-OPEN-FILE,
>>>etc.
>>>
>>>Also, check the customization variables:
>>>CUSTOM:*PATHNAME-ENCODING*
>>>CUSTOM:*DEFAULT-FILE-ENCODING*
>>>CUSTOM:*TERMINAL-ENCODING*
>>>CUSTOM:*MISC-ENCODING*
>>>#+FFI CUSTOM:*FOREIGN-ENCODING*
>>>
>>>Notice that clisp doesn't use keywords to specify external-formats, but
>>>objects built with EXT:MAKE-ENCODING. Some of them are predefined in
>>>the CHARSET package.
>>
>> I will explore those. I stumbled on the EXT:MAKE_ENCODING function, but was
>> unable to determine what to do with the object it created. I'll read up on
>> EXTERNAL-FORMAT and the CUSTOM:etc variable and hope that understanding dawns.
>
>Basically, you put something like:
>
> (setf custom:*pathname-encoding* (ext:make-encoding :charset charset:iso-8859-1
> :line-terminator :unix))
> (setf custom:*default-file-encoding* (ext:make-encoding :charset charset:utf-8
> :line-terminator :unix))
> (setf custom:*terminal-encoding* (ext:make-encoding :charset charset:utf-8
> :line-terminator :unix))
> (setf custom:*misc-encoding* (ext:make-encoding :charset charset:utf-8
> :line-terminator :unix))
> #+ffi (setf custom:*foreign-encoding* (ext:make-encoding :charset charset:iso-8859-1
> :line-terminator :unix))
>in your ~/.clisprc.lisp
>
>You can also use the -E option, eg.: clisp -ansi -E utf-8
I think I'm going to have to punt on this and change some of my parameters!
Note that I have zero UNIX experience and have never used C or any of its
descendants. I'm an old (24 years retired) IBM main-frame programmer, mostly in
assembler language, so much of the documentation goes over my head. Sorry.
For example, I'm not sure what "in you ~/clisprc.lisp" means.
My windows short-cut invoking clisp has been:
"C:\Program Files\clisp-2.49\clisp.exe" -K full -I -M MyLisp.mem -E ISO-8859-1
where "MyLisp.mem" is a saved image (is this the correct term?) after I have
loaded a bunch of macros and function which replicate some features of LISP/VM
which I am used to.
I am using the United States-International, so Ctrl-Alt-s should give me ß
(German sharp-s). When I type that into clisp I get an error "beep", and
nothing is echoed (or saved).
What I have tried.
I modified the invocation, first simply adding the -ansi, than changing
ISO-8859-1 to utf-8. Didn't help.
I ran the five setf expressions which you provided, but this also failed to
change the behavior.
I then fell further down the rabbit hole, trying to see which code-page the DOS
window was using. My attempt failed as follows
[6]> (ext:run-program "C:/windows/system32/chcp.com")
Parameter format not correct - /windows
1
Trying to set the code page had the same failure:
[5]> (ext:run-program "C:/windows/system32/chcp.com" :arguments '("1252"))
Parameter format not correct - /windows
1
So it seems that I'm missing some important point here. Since (as far as I can
tell) READ-LINE and WRITE-LINE seem to work (even if the characters appear
garbled internally, they look the same written as read) I'll just have to change
some of the constants in my programs to avoid them.
Thanks of the attempt to help me, I guess I'm just too dense.
P. Taine