[Zope] Unicode ZPT and XML woes

Jim Kutter jim at ebizq.net
Thu Nov 13 11:08:20 EST 2003


So I'm trying to write an XML RSS feed using Page Templates.

I'm having problems where I pull metadata out of a catalog, and try to
use it as the item title for the feed 

--
...
<item tal:repeat="item python: here.search.news_catalog({'post_date':
[here.ZopeTime()-1, here.ZopeTime()], 'post_date_usage':
'range:min:max', 'sort_on':'post_date', 'sort_order':'reverse'})">
    <title tal:content="item/head">
      Title Here
    </title>
...
 </item>
--

I get 
Error Type: UnicodeError
Error Value: ASCII decoding error: ordinal not in range(128)

It seems that I'm getting trapped in unicode hell, as that item/head is
in ascii, and the ZPT is in unicode?

I've tried every combination of encoding the head string (tuf8, utf16,
ascii) with either replace or ignore, with no luck.

Aside from re-implenting the stream as a DTML or Python script what can
I do?

I've already also tried the "LOCALIZER_USE_ZOPE_UNICODE=yes" suggestion
from the list archives.

-jim





More information about the Zope mailing list