On March 21, 2012 12:52:03 AM Matěj Cepl wrote:
> I am trying to write a plugin for ofxstatement script to import
> statements from my bank (Postal Savings Bank in Prague, Czech republic).
> I have now here slightly modified version of the OFX document
> http://mcepl.fedorapeople.org/tmp/HIST_211202112_201203181608.ofx. With
> ofxdump from libofx-0.9.4-3.el6.x86_64 I get plenty of errors on stderr like
> (Above message occured on Line 48, Column 21)
> LibOFX ERROR: OpenSP parser: otherError (misc parse error):
> /tmp/libofxtmpWNlNLz:48:21:E: non SGML character number 173
> and ofxdump produces corrupted characters. When importing this file into
> Gnucash I get corrupted characters as well (see
> http://mcepl.fedorapeople.org/tmp/gnucash-corrupted-encoding.png for a
> Author of ofxstatement (put to CC of this email) suggested to replace
> the top of the file with
> but although ofxdump was then able to read it correctly, gnucash still
> imports corrupted text in both payee and memo fields.
> Any ideas, what's wrong with my OFX document?
Nothing is wrong with your OFX document. There were problems with OFX 2.0 support in libofx which were discovered and fixed in git a only a few weeks ago (OFX 2.0 is still aparently pretty rare in the wild). The fixes will be in the upcoming 0.9.6 (and I checked that your file works fine).
For now you'd need to compile directly from git:
git clone git://libofx.git.sourceforge.net/gitroot/libofx/libofx
sudo make install
Or run a git snapshot. For ubuntu that would be found at: https://launchpad.net/~benoitg/+archive/libofx-daily, and can be added with
sudo apt-add-repository ppa:benoitg/libofx-daily
sudo apt-get update
sudo apt-get install ofx
Benoit Grégoire, ing., PMP, PSM