Re: Question on UTF-8 output over CGI

Jean Louis <[email protected]> Fri, 28 Sep 2018 07:44:59 +0200
Newsgroups gmane.lisp.clisp.general
Message-ID <[email protected]>
On Fri, Sep 28, 2018 at 06:54:15AM +0200, Gunter Königsmann wrote:
> What is transferred over CGI in the erroneous
> case. And just to make sure that the problem
> lies in CLISP: Is it possible that clisp
> actually outputs UTF8 and one of the other tools
> involved is convinced not to get Unicode and
> converts the characters somehow?

It is Apache server, and it could be a problem as
.lisp scripts are automatically run on my system
through binfmt_misc file system by clisp.

> On Linux outputting UTF8 works by default
> without seting any format. On Windows I do an
> additional
> 
> (setf (stream-external-format
> *socket-connection*) charset:utf-8)

I have no variable *socket-connection*

> Is your lisp file unicode oder
> codepage-something-encoded?

It is just plain file, with one Unicode character
inside.

Then I found out if I don't use automatic
invocation of CLISP for .lisp files, and run the
encoding.cgi file like this below it will not
work:

#!/usr/bin/clisp
;; (setf custom:*default-file-encoding* "utf-8")
;; (setf custom:*misc-encoding* "utf-8")
;; (setf custom:*terminal-encoding* "utf-8")
;; (setf custom:*pathname-encoding* "utf-8")
;; (setf custom:*foreign-encoding* "utf-8")

(defun headers ()
  (format t "Content-type: text/plain; charset=\"UTF-8\"~2%"))

(headers)
(format t "~A č" (getenv "LANG"))
(exit)


But if I use this invocation, that it works:

#!/usr/bin/clisp -E utf-8
;; (setf custom:*default-file-encoding* "utf-8")
;; (setf custom:*misc-encoding* "utf-8")
;; (setf custom:*terminal-encoding* "utf-8")
;; (setf custom:*pathname-encoding* "utf-8")
;; (setf custom:*foreign-encoding* "utf-8")

(defun headers ()
  (format t "Content-type: text/plain; charset=\"UTF-8\"~2%"))

(headers)
(format t "~A č" (getenv "LANG"))
(exit)


and I am still concerned that I cannot set those
encodings within the script.

-- 
Jean Louis


_______________________________________________
clisp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-list