OFX Statement Import fails on UTF-8 encoded file containing german umlauts
Receiving camt.052 (XML) from Bank which i convert to OFX using ofxconvert. Resulting file is UTF-8 encoded containing some special chars (for exampel: Receiver of Payment “Finanzamt Mühlacker”).
Stack-Trace is as follows:
Traceback (most recent call last): File "/srv/tryton/edp60int/venv/lib/python37/site-packages/trytond/wsgipy", line 117, in dispatch_request return endpoint(request, **requestview_args) File "/srv/tryton/edp60int/venv/lib/python37/site-packages/trytond/protocols/dispatcherpy", line 48, in rpc request, database_name, *requestrpc_params) File "/srv/tryton/edp60int/venv/lib/python37/site-packages/trytond/wsgipy", line 84, in auth_required return wrapped(*args, **kwargs) File "/srv/tryton/edp60int/venv/lib/python37/site-packages/trytond/protocols/wrapperspy", line 156, in wrapper return func(request, pool, *args, **kwargs) File "/srv/tryton/edp60int/venv/lib/python37/site-packages/trytond/protocols/dispatcherpy", line 181, in dispatch result = rpcresult(meth(*c_args, **c_kwargs)) File "/srv/tryton/edp60int/venv/lib/python37/site-packages/trytond/wizard/wizardpy", line 314, in execute return wizard_execute(state_name) File "/srv/tryton/edp60int/venv/lib/python37/site-packages/trytond/wizard/wizardpy", line 340, in execute do_result = do(action) File "/srv/tryton/edp60int/venv/lib/python37/site-packages/trytond/modules/account_statement/statementpy", line 1198, in do_import statements = list(getattr(self, 'parse%s' % selfstartfile_format)()) File "/srv/tryton/edp60int/venv/lib/python37/site-packages/trytond/modules/account_statement_ofx/accountpy", line 27, in parse_ofx ofx = ofxparseOfxParserparse(file_) File "/srv/tryton/edp60int/venv/lib/python37/site-packages/ofxparse/ofxparsepy", line 387, in parse ofx_file = OfxPreprocessedFile(file_handle) File "/srv/tryton/edp60int/venv/lib/python37/site-packages/ofxparse/ofxparsepy", line 152, in init ofx_string = selffhread() File "/usr/lib/python37/codecspy", line 504, in read newchars, decodedbytes = selfdecode(data, selferrors) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 806: ordinal not in range(128) ``
Anonymized OFX-File is attached.
Chris
Files
Download | Creator | Timestamp | Type |
---|---|---|---|
2021-03-04.UTF8-Test.ofx | @chrisexner | 2021-05-25 14:51:15.607000 UTC | text/plain |