Hi,
On Thu, Oct 8, 2009 at 9:27 PM, Sebastian Tennant sebyte@smolny.plus.com wrote:
I don't often see messages of thanks on open source software mailing lists, so, without wishing to sound obsequious, let me buck the trend by thanking Edi, and everone else, before and since, for their work on hunchentoot.
Thanks... :)
I've found that setting this at the top level of cl-user:
(setf tbnl:*hunchentoot-default-external-format* tbnl::+utf-8+)
has no effect, other than preventing an error when a handler produces non-ascii text, i.e., the non-ascii text is garbled when displayed in the browser, despite including the line:
(setf (tbnl:content-type*) "text/html; charset=utf-8")
in the handler.
The problem is solved by also including the line:
(setf (tbnl:reply-external-format tbnl:*REPLY*) tbnl::+utf-8+)
in the handler, so what then is the purpose if the special variable?
As explained in the documentation, the special variable *HUNCHENTOOT-DEFAULT-EXTERNAL-FORMAT* is used when computing the /request/ object. As you said, it doesn't have an effect on the reply.
The test suite which is delivered with Hunchentoot contains examples for UTF-8 output.
HTH, Edi.