mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
Merge pull request #21 from StefanRijnhart/7.0-camt_encoding
[FIX] Anticipate wrong encoding in camt files
This commit is contained in:
@@ -273,7 +273,11 @@ CAMT Format parser
|
|||||||
"""
|
"""
|
||||||
Parse a CAMT053 XML file
|
Parse a CAMT053 XML file
|
||||||
"""
|
"""
|
||||||
root = etree.fromstring(data)
|
try:
|
||||||
|
root = etree.fromstring(data)
|
||||||
|
except etree.XMLSyntaxError:
|
||||||
|
# ABNAmro is known to mix up encodings
|
||||||
|
root = etree.fromstring(data.decode('iso-8859-15').encode('utf-8'))
|
||||||
self.ns = root.tag[:root.tag.index("}") + 1]
|
self.ns = root.tag[:root.tag.index("}") + 1]
|
||||||
self.check_version()
|
self.check_version()
|
||||||
self.assert_tag(root[0][0], 'GrpHdr')
|
self.assert_tag(root[0][0], 'GrpHdr')
|
||||||
|
|||||||
Reference in New Issue
Block a user