[Kmymoney-devel] OFX and UTF-8 problem

Cristian Oneț onet.cristian at gmail.com
Wed Jan 18 12:00:31 UTC 2012

2012/1/18 Martin Javorek <martin at javorkovi.cz>:
> Cristian,
> thanks a lot for investigation.
>> As a side-note the file you've provided needs an extra OFX header to be
>> interpreted with the correct encoding by libofx (used by the plugin to import
>> OFX files) as in the attached version. Without that header the import won't
>> work correctly anyway.
>> To test that you have a correct OFX file you can use the ofxdump application.
>> For the attached file it yields (I add only the memo line):
>>   Extra transaction information (memo): Životní pojištění - Investor
>> While for your original file the output is:
>>     Extra transaction information (memo): Ä‚ivotní pojiÅ¡tÄ›ní - Investor
>> Thanks for spotting this bug :).
> It is a little bit strange. I'm generating OFX statement using my own OFX generator in Java. It converts proprietary TXT format from my bank to OFX using OFX4J library. Library supports OFX version 1 or 2. 1 is text format with opened XML tags, 2 is valid XML format. I'm using version 2 as it looks better :-) But, those text headers this library generates only for version 1.
> I was playing a little bit with MT2OFX program and converting my statement from and to different formats. And the same result - version 1 has text headers as you sent me, version 2 has only XML headers:
>  <?xml version="1.0" encoding="utf-8" ?>
> If I'm thinking in terms of XSD validations of OFX version 2 (http://www.ofx.net/DownloadPage/Downloads.aspx), I cannot imagine, how to validate XML with those strange text headers against some schema.
> As the OFX4J is open source, I can force it to generate text headers into my OFX files, but - is it really OK?

It could be that libofx (ofxdump is part of the project) has a
problem. KMyMoney uses libofx to import OFX data. I think you should
post the above question to the project's developers [1]. My
observation that with the text header it works and without it does not
was empirical :).


[1] http://libofx.sourceforge.net/

> Thanks,
> Martin

More information about the KMyMoney-devel mailing list