Hi Ricardo!

Ricardo Alves wrote:
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:
    ...

I agree that _importNode() should fall back to this encoding if default_charset is not specified in the import.

Please report the bug to https://bugs.launchpad.net/zope-cmf/ .

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...

Yes. This is a Plone issue.


Cheers,

        Yuppie

_______________________________________________
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

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

Reply via email to