Neil Schemenauer wrote: > On Fri, Sep 03, 2004 at 01:26:38PM +0200, Marcin Wojdyr wrote: >> If there are non-ascii chars in PTL it doesn't work: > [...] >> File "/usr/lib/python2.3/site-packages/quixote/http_response.py", line >> 210, in set_body self.body = unicode(body).encode(self.charset) >> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position >> 954: >> ordinal not in range(128) > > You need to use unicode strings if you want to use non-ascii > characters. Thanks for your reply, but I think I need more hints. In demo/pages.ptl I added, at the beginning of _q_index following lines: request.response.set_charset(str('UTF-8')) unichr(0xf3) and Traceback (most recent call last): File "/usr/lib/python2.3/site-packages/quixote/publish.py", line 525, in process_request output = self.try_publish(request, env.get('PATH_INFO', '')) File "/usr/lib/python2.3/site-packages/quixote/publish.py", line 458, in try_publish output = object(request) File "/usr/lib/python2.3/site-packages/quixote/demo/pages.ptl", line 14, in _q_index unichr(0xf3) UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 0: ordinal not in range(128) Could you give an minimal example of page with non-ascii characters, that is encoded as set with set_charset()? Marcin -- Marcin Wojdyr | http://www.unipress.waw.pl/~wojdyr