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

Tobia tobia.conforto at linux.it
Sat Mar 17 18:13:59 UTC 2007


Victor Kryukov wrote:
> I'm trying to output some cyrillic letters

Your example, slightly modified, works fine on my system*

I say slightly modified as I don't know where to find the with-html
macro you used.  Here's what I did:

	(asdf:operate 'asdf:load-op :hunchentoot)
	(asdf:operate 'asdf:load-op :cl-who)

	(defpackage :test (:use :cl :cl-who :hunchentoot))
	(in-package :test)

	(setf *default-content-type* "text/html; charset=utf-8")
	(setf *hunchentoot-default-external-format*
	      (flex:make-external-format :utf-8 :eol-style :lf))
	(setf *dispatch-table* (list #'dispatch-easy-handlers))

	(define-easy-handler (home :uri "/") ()
	  (with-html-output (*standard-output* nil)
	    (:html
	      (:head (:title "Test page"))
	      (:body                      
	        (:h2 "Main page")
	        (:p "Русский тест")))))


HTH,
Tobia

* Debian Sid, SBCL 1.0, Hunchentoot 0.7.2, CL-WHO 0.6.2, Opera 9.10



More information about the Tbnl-devel mailing list