GNOME Bugzilla – Bug 639647
OFX import does not import UTF-8 nicely.
Last modified: 2018-06-29 22:52:06 UTC
When importing an OFX file in non-ascii UTF-8, Gnucash shows garbled text for description fields. The sample file I have includes a CHARSET directive which could be used to determine the file encoding (not ideal but what can you do?). For reference, the file is intended for Microsoft Money and was downloaded from Mitsubishi UFJ Bank in Japan.
*** Bug 629856 has been marked as a duplicate of this bug. ***
As the other bug states that there is a normal xml header in his document, there may be several, semi-standard hints as to the encoding of the document. In my case the CHARSET tag, but an xml header may also be present?
Created attachment 198655 [details] Example UTF-8 encoded ofx file
Looking into this a bit more, it looks like it might be a problem with libofx. When libofx parses the file I get a lot of errors like the following printed to the console: (Above message occured on Line 189, Column 7) LibOFX ERROR: OpenSP parser: otherError (misc parse error): /tmp/libofxtmpl5P599:189:7:E: non SGML character number 166 (Above message occured on Line 189, Column 8) LibOFX ERROR: OpenSP parser: otherError (misc parse error): /tmp/libofxtmpl5P599:189:8:E: non SGML character number 197 (Above message occured on Line 189, Column 9) LibOFX ERROR: OpenSP parser: otherError (misc parse error): /tmp/libofxtmpl5P599:189:9:E: non SGML character number 146 This seems to happen when it encounters a Japanese character (non-ascii?). I also checked the data being passed into the transaction callback ofx_proc_transaction_cb(). The name and memo fields are already garbage characters so it doesn't look like Gnucash itself is doing anything to cause the problem.
It seems that that has been fixed in more recent versions of LibOFX but Ubuntu has the relatively old version 0.9.0 which is why I ran into this bug. This is fixed and is not a gnucash issue so I'm closing the bug. *** This bug has been marked as a duplicate of bug 627773 ***
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=639647. Please update any external references or bookmarks.