[hunchentoot-devel] Using utf-8 strings with with-html macro.

Robert Synnott rsynnott at gmail.com
Sat Mar 17 18:06:38 UTC 2007


On 3/17/07, Victor Kryukov <victor.kryukov at gmail.com> wrote:
>
> Hello list,
>
> I'm trying to output some cyrillic letters on the web page like this:
>
> (setf *hunchentoot-default-external-format*
>       (flex:make-external-format :utf-8 :eol-style :lf))
>
> (defun main-page ()
>   (setf (content-type) "text/html; charset=utf-8")
>   (with-html
>       (:html
>        (:head (:title "Test page"))
>        (:body
>  (:h2 "Main page")
>  (:p "Русский тест") ; Cyrillic letters - "Russian test"
>  ))))
>
> but the resulted page is empty. The lisp file itself in utf-8 coding system.
> Am I missing something?
>
> My system is Ubuntu 2.6.17, sbcl 1.0.3.38, hunchentoot 0.7.2
>
> Thanks a lot,
>
> Victor Kryukov
> http://antlook.com
>
>
>
>
> _______________________________________________
> tbnl-devel site list
> tbnl-devel at common-lisp.net

I think, though I'm not sure, that you should be using the
with-html-output-to-string macro; it may be that at the moment it's
just printing it to standard output (whereas it should be returning
the page as a string). You could try something like (defun my-page ()
"Put some unicode characters here") to see if it's an issue with your
hunchentoot, though.
Rob


More information about the Tbnl-devel mailing list