[Bese-devel] utf-8 encoding problem

Maciek Pasternacki maciekp at japhy.fnord.org
Tue May 30 12:45:31 UTC 2006


On Setting Orange, Confusion 4, 3172 YOLD, hbabcockos1 at mac.com wrote:

> I updated my version of UCW today and now I'm struggling to get utf8
> strings to my browser in a form that it can understand. If I try
> something like this:
>
> (defun utf8-string ()
>   (let ((my-string (make-array 3 :element-type 'character :initial- 
> element #\SPACE)))
>     (setf (char my-string 0) (code-char #xE5))
>     (setf (char my-string 1) (code-char #x91))
>     (setf (char my-string 2) (code-char #xB5))
>     my-string))
>
> (<:p (<:as-html (utf8-string)))     ; this would be in a render function

Because strings are not sequences of bytes, but of characters. Just
use a string with real Unicode characters.  Which Lisp implementation
are you using?  Which UCW backend?  Httpd backend on SBCL and Clisp
should work, I'm not sure about other combinations.

-- 
__    Maciek Pasternacki <maciekp at japhy.fnord.org> [ http://japhy.fnord.org/ ]
`| _   |_\  / { Hac in hora sine mora corde pulsum tangite;
,|{-}|}| }\/         quod per sortem sternit fortem, mecum omnes plangite!   }
\/   |____/                                           ( Carmina Burana )  -><-



More information about the bese-devel mailing list