Commit f568830b authored by Michal Čihař's avatar Michal Čihař

Encode to utf-8 before parsing XML

parent 95f7e01d
......@@ -678,7 +678,7 @@ class XMLTagsCheck(TargetCheck):
return False
# Check if source is XML
try:
source_tree = ElementTree.fromstring('<weblate>%s</weblate>' % source)
source_tree = ElementTree.fromstring('<weblate>%s</weblate>' % source.encode('utf-8'))
source_tags = [x.tag for x in source_tree.iter()]
self.set_cache(unit, source_tags)
except:
......@@ -688,7 +688,7 @@ class XMLTagsCheck(TargetCheck):
# Check target
try:
target_tree = ElementTree.fromstring('<weblate>%s</weblate>' % target)
target_tree = ElementTree.fromstring('<weblate>%s</weblate>' % target.encode('utf-8'))
target_tags = [x.tag for x in target_tree.iter()]
except:
# Target is not valid XML
......
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