[Openmcl-devel] encoding/decoding clozure strings to/from UTF-8

Karsten Poeck Karsten.Poeck at gmail.com
Tue Dec 30 14:40:33 PST 2014


On 30.12.14 23:30, Karsten Poeck wrote:

>
> but it seems that somewhere the header content-type is specified as
> Content-Type    text/html; charset=ISO-8859-1
>

oops, that was easy.
The following seems to work

(defmethod test-utf-8 ((url t) stream)
   (http:with-successful-response (stream :html :character-set :utf-8 
:expires (url:expiration-universal-time url))
     (let ((title "Test-UTF-8"))
       (with-html-document (:stream stream)
         (with-document-preamble (:stream stream)
           (declare-title title :stream stream)
           (with-document-body (:stream stream)
             (write-string "$¢€" stream)))))))

and the header is:
Content-Type: text/html; charset=UTF-8

regards

Karsten




More information about the Openmcl-devel mailing list