准备用 common lisp 的 aserver 来写一个 web 的小应用,遇到的第一个难题就是, 中文怎么显示,
因为使用如下代码,汉字直接就不见了.
repl 会报如下的错误 got error The value xxxxx is not of type (UNSIGNED-BYTE 8).
(defun random-number (request entity)
(with-http-response (request entity :content-type "text/html")
(with-http-body (request entity)
(html
(:html
(:head (:title "Random"))
(:body
(:p (:princ (to-octets-string "Random number: 你")))))
google, 居然又被墙了, faint
无奈之下,用 cn.bing.com 找到一个人和我出现了同样的问题
4-aserve-worker:
01/12/09 - 20:39:09 - while processing command "GET / HTTP/1.1" got
error The value 12354 is not of type (UNSIGNED-BYTE 8). ...
<[雑記]あけましておめでとうござ... | [lisp]UTF8の ...
d.hatena.ne.jp/nagayoru/20090112/1231769571 ·
阅读(857) | 评论(1) | 转发(0) |