2008년 9월 8일 월요일

hunchentoot 한글(유니코드) 출력하기

전에도 고민했던 문제였는데 다시 만나게 되서 삽질을 또 해봤는데

이번에 한 삽질 보기


헐 시바 그런데 존내 간단한 해결방법이 있었네
http://osdir.com/ml/lisp.html-template.general/2007-05/msg00004.html
예전엔 왜 못봤지?


그래서 위 코드를 적용하고 나니 위의 foo 와 baz 가 이렇게 간단히 변했다.

(setf hunchentoot:*hunchentoot-default-external-format* :UTF-8)

(defun foo ()
"한글")
(defun baz ()
(let ((s (send-headers)))
(fill-and-print-template (create-template-printer "안녕 <!-- TMPL_VAR world -->")
'(:world "세상")
:stream s)))


아 쉬바...



댓글 없음: