I'm having a problem with encoding of properties.xml, and I'm not sure if its an issue of CMFCore or Plone. Maybe it's not even an issue, but here it goes:

If the properties.xml file doesn't include any charset declaration, in CMFCore.exportimport.properties, _importNode relies on default-zpublisher-encoding (defined at zope.conf) and not in the context/site charset, like _exportNode does.

So, if we have default-zpublisher-encoding set to 'iso-8859-1' and the site charset is 'utf-8', property values will be stored encoded as 'iso-8859-1'.

One possible fix, would be to get the context encoding in _importNode, just like _exportNode:

def _importNode(self, node):
        """Import the object from the DOM node.
+ self._encoding = self.context.getProperty('default_charset', 'utf-8')
        for child in node.childNodes:

But there is another problem: even then, it wouldn't work for Plone. The 'default_charset' property is only available at portal.portal_properties.site_properties, so context.getProperty('default_charset') will fail. But, I guess, this is a Plone problem...

Any thoughts?

Thanks for your attention,

Ricardo Alves
Zope-CMF maillist  -  Zope-CMF@lists.zope.org

See http://collector.zope.org/CMF for bug reports and feature requests

Reply via email to