Skip to content

Commit

Permalink
[FIX] l10n_es_account_bank_statement_import_n43: Change encoding for …
Browse files Browse the repository at this point in the history
…compatibility with BBVA files (#1056)

Some statement files include BOM data (https://es.wikipedia.org/wiki/Marca_de_orden_de_bytes) at the beginning of the file, making them non readable by current parser, as fixed positions are moved in these cases and thus expected data is not matched.

As ASCII, which is the encoding used in files according specification, is a subset of UTF-8, there's no danger in using it with the variant 'utf-8-sig' for handling if BOM marker is present or not.
  • Loading branch information
jffernandez authored and pedrobaeza committed Apr 12, 2019
1 parent 9056544 commit 1eea555
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def _parse(self, data_file):
return st_data['groups']

def _check_n43(self, data_file):
data_file = data_file.decode('iso-8859-1')
data_file = data_file.decode('utf-8-sig')
try:
n43 = self._parse(data_file)
except exceptions.ValidationError: # pragma: no cover
Expand Down

0 comments on commit 1eea555

Please sign in to comment.