Forum OpenACS Q&A: Re: a problem with tcl and ascii > 127

Collapse
Posted by Simon Buckle on
It looks like a character conversion problem. Tcl 8.1 and later stores strings internally as Unicode, specifically UTF-8 although it appears that some commands, such as regsub, convert between UCS-2 and UTF-8.

The UCS-2 value of ë is 0x00EB. The UTF-8 encoding of 0x00EB is xC3 xAB. In ISO-8859-1, xC3 is  and xAB is « which are the characters that are displayed in the demo script you linked to.

If you are sending out the raw bytes, try setting the character set in the Content-Type header, e.g

ns_return 200 "text/html; charset=utf-8" ...


Have a look at this document for more information.