[z3-five] unicodes and strings in Zope 2.9's ZPT with Zope 3's i18n

Maciej Wisniowski maciej.wisniowski at coig.katowice.pl
Wed Jul 19 23:52:30 CEST 2006


>Now authors of those apps will either have to:
>
>- do a massive and fine-toothed-comb data migration turning all encoded 
>strings into unicode
>
>- change all their templates to have horrific stuff like:
>   <div 
>tal:content="python:obj.getProperty('something','').decode('utf-8')"/>
>   ...rather than:
>   <div tal:content="obj/something|default"/>
>
>- suffer frequent but not necessarilly reproducible, content-dependent 
>unicode errors
>  
>
Exactly. Yesterday I was rewriting a form that was build via ZMI
(ZPT and PythonScripts) to Five product. I ecouncered same
problems as you.

> - suffer frequent but not necessarilly reproducible, content-dependent 
> unicode errors

In my case, same code works on one machine but fails with
unicode-decode errors on the second one...
You need to be very very careful when writing something and even
test the code on few machines... :-/

Other thing. Adding a new object (that uses addform directive and
has 'title' field in it's schema - unicode!) to a folder (via ZMI), may
result in strange characters displayed instead of national
characters in other objects' titles or, in the worst case, Unicode-decode
error when you're clicking on that folder in ZMI (you have to use Undo
then because it's not possible to see the folder contents).

-- 
Maciej Wisniowski


More information about the z3-five mailing list