Plone UnicodeDecodeError in portal_tabs

A UnicodeDecodeError error occurs when using non-standard ASCII characters like spanish letters "áéíóúñ..." within the ``portal_tabs`` category.

This bug has been report to Launchpad, see Zope CMF BUG #267356: UnicodeDecodeError in ActionInformation.py.

To fix this bug I have used unicode() constructor to create a Unicode string. This is the 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

Filed under:


I'm now reading