[Zope-CMF] Re: CMFCore.exportimport.properties import encoding
Ricardo Alves
lafere at gmail.com
Tue Jul 15 19:11:07 EDT 2008
yuppie wrote:
> 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/ .
OK, reported: https://bugs.launchpad.net/zope-cmf/+bug/248853
Thanks,
Ricardo
More information about the Zope-CMF
mailing list