[hunchentoot-devel] Re: utf-8 encoding problems

Robert Synnott rsynnott at gmail.com
Tue Sep 2 20:38:16 UTC 2008


2008/9/2 Andrei Stebakov <lispercat at gmail.com>:
> No luck emailing the quotation marks. Let's try a German character 'ß'
>
> (defun test-handler ()
>   (no-cache)
>   (recompute-request-parameters :external-format (flex:make-external-format
> :utf-8 :eol-style :lf))
>   (setf (hunchentoot:content-type) "text/html; charset=utf-8")
>   (with-html-output-to-string (*standard-output* nil :prologue nil :indent
> nil)
>     (:html
>      (:head
>       (:title "Test page"))
>      (:body
>       (:p "weiß")))))
>
> Will produce text like "wei�"
> If I set the global variable:
> (setf *hunchentoot-default-external-format* (flex:make-external-format
> :utf-8 :eol-style :lf))
> the problem gets fixed.
>
> Andrew
>

As a matter of interest, why do you have a problem using UTF8
everywhere? Just about everything supports it these days, and the
lower seven bits look like ASCII?

Anyway, (setf (reply-external-format &optional reply) new-value) with
the make-external-format thing as 'new-value' should do the trick.
Rob


More information about the Tbnl-devel mailing list