Wenn ich einen request sende über GET/POST und den Inhalt ausgebe und dieser ein nonascii Zeichen besitzt (öüß..) stirbt das Script mit dieser Fehlermeldung.
Die Tips im Forum und im Wiki habe ich beachtet aber ich komme auf keine Lösung.[Fri Dec 15 19:04:17 2006] [error] [client 127.0.0.1] PythonHandler mod_python.publisher: UnicodeEncodeError: 'ascii' codec can't encode character u'\\xf6' in position 130: ordinal not in range(128), referer: http://localhost/python/bla/?para1=sadsds
Vielleicht sieht jemand mehr

python:
Code: Alles auswählen
# -*- coding: utf-8 -*-
from jinja import Template, Context, FileSystemLoader
def bla(para1):
t = Template('bla', FileSystemLoader('/var/www/templates/'))
c = Context({
'para1' : para1
}
)
return t.render(c)
Code: Alles auswählen
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
{{ para1 }}
<form>
<input type="text" name="para1">
<input type="submit">
</form>
</body>
</html>
py version 2.4
conf.d/charset:AddDefaultCharset UTF-8
debian/apache2 mit mod_python