23 May
2005
23 May
'05
8:35 a.m.
Hello, i would like to feed a zpt form with data from a python dictionary via a python script zpt snippet: <textarea name="title:record:ulines" rows="3" cols="65"> <tal:span content="python:context.printDict(here.dict)"/> </textarea> python script prinDict: keys_ = dict.keys() keys_.sort() lines=[] for key in keys_: lines.append(u"%s:%s\n" %(key ,dict[key])) uni_str = u"".join(lines) return uni_str.encode('utf-8') I'm always getting a UnicodeDecodeError. I' using Zope 2.7.5, CMF 1.5.1, Python 2.3.5 HTML meta tag is set to <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> CMF default_charset = utf-8 Regards Joern