Plone UnicodeDecodeError in portal_tabs

Plone genera un UnicodeDecodeError se si usano lettere accentate in portal_tabs

Questo bug è stato segnalato in Launchpad, guarda Zope CMF BUG #267356: UnicodeDecodeError in ActionInformation.py.

Ho risolto il bug usando il constructor unicode() che crea una stringa Unicode.

Questa è la patch:

--- eggs/Products.CMFCore-2.1.2-py2.4.egg/Products/CMFCore/ActionInformation.py.orig        2010-03-22 12:36:14.000000000 +0100
+++ eggs/Products.CMFCore-2.1.2-py2.4.egg/Products/CMFCore/ActionInformation.py     2010-03-22 12:37:37.000000000 +0100
@@ -148,7 +148,7 @@
             elif id == 'i18n_domain':
                 continue
             elif self.i18n_domain and id in ('title', 'description'):
-                val = Message(str(val), self.i18n_domain)
+                val = Message(unicode(val, encoding='utf-8'), self.i18n_domain)
             lazy_map[id] = val

         return (lazy_map, lazy_keys)

SpiderWeb

archiviato sotto:


Ora sto leggendo