[hunchentoot-devel] utf-8 encoding problems

Andrei Stebakov lispercat at gmail.com
Tue Sep 2 18:03:57 UTC 2008


I have problems with some of the utf-8 characters in sbcl 1.0.18 and
hunchentoot-0.15.7 (Ubuntu)
When I create a handler like this:

(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

""quotation"")))))


Where I have those "right and left quotation marks" I get an error:
#\LEFT_DOUBLE_QUOTATION_MARK (code 8220) is not a LATIN-1 character.
   [Condition of type FLEXI-STREAMS:EXTERNAL-FORMAT-ENCODING-ERROR]

If, on the other hand, I set global variable
*hunchentoot-default-external-format* to utf-8
(setf *hunchentoot-default-external-format* (flex:make-external-format
:utf-8 :eol-style :lf))
then everything works.
I just want one handler to handle the uft-8 encoding, how can I fix it?

Thank you,
Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/tbnl-devel/attachments/20080902/d863b7b1/attachment.html>


More information about the Tbnl-devel mailing list