On Thu, Apr 01, 2010 at 02:47:36PM +0200, Hanno Schlichting wrote:
On Thu, Apr 1, 2010 at 11:52 AM, Marius Gedminas <marius@gedmin.as> wrote:
I don't think I'll be able to work on it, but I think it's worth consideration: Unicode issues with Zope 2.12. I've seen these on at least three different Zope 2 sites built with a combination of TTW page templates, Python scripts and (sometimes) DTML documents: things like title attributes store their data as UTF-8 strings, while page templates insist on Unicode objects, resulting in errors all over the place.
Those sites worked with Zope 2.9 and broke down after an upgrade to 2.12. That's a not very nice thing to do to your users...
They broke down after the move to Zope 2.10.
Probably; the sites I helped upgrade skipped over 2.10 and 2.11.
We switched Zope 2 to using the zope.tal / zope.tales packages in favor of Zope 2's own implementation. As a result TAL uses Unicode internally ever since. There's the whole unicoderesolver story, which allows you to implement an application specific fallback story. We decided back then, that dealing with this problem would be left to each application, as Zope 2 in general has too little knowledge about your data - and nobody volunteered to do any work on it ;)
What if there's no application, just a Zope 2 website, using TTW scripts for implementing things like navigation menus? E.g. Page Templates come with a 'title' property of type string, not ustring, and there are big fat bold warnings not to delete it, which would be a prerequisite for creating an ustring version.
If you have a rather large application with third-party plugins and have to deal with the encoded string to Unicode conversion, I think such a long term upgrade story with policy changes happening around major releases is the only way to go. If you have a pure-inhouse application you can do a data and code conversion as single project and get over with.
How can I do a data conversion when the data in question is owned and managed by core Zope 2 objects, that can't agree on a common data format (string versus unicode)? Marius Gedminas -- http://pov.lt/ -- Zope 3 consulting and development