Commit 0383f19c authored by Jérome Perrin's avatar Jérome Perrin

doing str() on DOM parser results is dangerous, because it fails if the value...

doing str() on DOM parser results is dangerous, because it fails if the value contains non ascii characters.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16821 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f7179460
...@@ -1310,8 +1310,8 @@ class ScribusParser: ...@@ -1310,8 +1310,8 @@ class ScribusParser:
#iterating PAGEOBJECT attributes #iterating PAGEOBJECT attributes
#old parsing method employed also here #old parsing method employed also here
for node_id in page_object.attributes.keys(): for node_id in page_object.attributes.keys():
node_name = str(node_id) node_name = node_id.encode('utf8')
node_value = str(page_object.attributes[node_id].value) node_value = page_object.attributes[node_id].value.encode('utf8')
returned_page_object[node_name] = node_value returned_page_object[node_name] = node_value
...@@ -1367,8 +1367,8 @@ class ScribusParser: ...@@ -1367,8 +1367,8 @@ class ScribusParser:
field_OwnPage = '' field_OwnPage = ''
# iterating field attributes # iterating field attributes
for node_id in page_object.attributes.keys(): for node_id in page_object.attributes.keys():
node_name = str(node_id) node_name = node_id.encode('utf8')
node_value = str(page_object.attributes[node_id].value) node_value = page_object.attributes[node_id].value.encode('utf8')
if node_name == 'ANNAME': if node_name == 'ANNAME':
if node_value != '': if node_value != '':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment