> From: "Dmitri Ivanov" <postman.ru at divanov2>
> Date: Thu, 1 Mar 2001 10:46:56 +0300
>
> It works. But the following message is printed in the ACL Console:
>
> Warning: External-format `:CRLF-1251-BASE' passed to
> make-http-client-request filters line endings.
> Problems with protocol may occur.
>
> The more appropriate seems to be
> (with-http-body (req ent
> :external-format :1251-base)
> (html "Hello [...]")
That's right. I think, however, that it's more portable to use
utf-8, which covers all of Unicode, than to use windows-charset-1251,
which covers only Ascii and Cyrillic (Slavic). Fortunately, switching
the charset in this way only requires changing two places: (1) the
content-type statement, which informs the client (browser) which
charset to use; and (2) the with-http-body external-format, which
tells Lisp how to send characters to the client.
(publish :path "/hello"
:content-type "text/html; charset=utf-8"
:function #'(lambda (req ent)
(with-http-response (req ent)
(with-http-body (req ent
:external-format
(crlf-base-ef :utf-8))
(html "Hello [...]")))))
Charley
---
Charles A. Cox, Franz Inc. 1995 University Avenue, Suite 275
Internet: <franz.com at cox> Berkeley, CA 94704-1072
WWW: http://www.franz.com/ Phone: (510) 548-3600; FAX: (510) 548-8253