[Kmymoney-devel] OFX and UTF-8 problem

Martin Javorek martin at javorkovi.cz
Wed Feb 1 17:47:11 UTC 2012


Problematic "one transaction" file can be found as attachment in my original post
https://mail.kde.org/pipermail/kmymoney-devel/2012-January/007486.html

Or as an attachment of this email :-)

Martin

----- Original Message -----
From: "Benoit Grégoire" <benoitg at coeus.ca>
To: "Thomas Baumgart" <thb at net-bembel.de>
Cc: kmymoney-devel at kde.org, "Martin Javorek" <martin at javorkovi.cz>, "Cristian Oneț" <onet.cristian at gmail.com>
Sent: Wednesday, February 1, 2012 6:34:49 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna
Subject: Re: [Kmymoney-devel] OFX and UTF-8 problem

On January 23, 2012 02:24:39 PM Thomas Baumgart wrote:
> Hi,
> 
> on Monday 23 January 2012 13:52:47 Martin Javorek wrote:
> > > 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 :).
> > 
> > I want know more. So I have asked in ofxlib forum.
> > http://sourceforge.net/mailarchive/forum.php?thread_name=1738901.glNyNyvm3
> > L
> > %40benoitg-t510&forum_name=libofx-devel But it looks, there is maybe
> > something between KMyMoney ofxlib usage and ofxlib implementation.
> 
> Benoit asks, if we in KMyMoney do any preprocessing on the file's contents.
> That's an easy answer: no, because we only pass the filename to libofx.
> 
>   LibofxContextPtr ctx = libofx_get_new_context();
>   Q_CHECK_PTR(ctx);
> 
>   qDebug("setup callback routines");
>   ofx_set_transaction_cb(ctx, ofxTransactionCallback, this);
>   ofx_set_statement_cb(ctx, ofxStatementCallback, this);
>   ofx_set_account_cb(ctx, ofxAccountCallback, this);
>   ofx_set_security_cb(ctx, ofxSecurityCallback, this);
>   ofx_set_status_cb(ctx, ofxStatusCallback, this);
>   qDebug("process data");
>   libofx_proc_file(ctx, filename_deep, AUTODETECT);       <------
>   libofx_free_context(ctx);
> 
> Inside the callbacks, we expect data to be UTF-8 formatted. E.g. for the
> transaction callback:
> 
>   if (data.check_number_valid == true) {
>     t.m_strNumber = QString::fromUtf8(data.check_number);
>   }

Well, this should work.  Can you send me a sample of a problematic file?

In any event, OFX2 files should NOT have text headers...
-- 
Benoit Grégoire, ing., PMP, PSM
-------------- next part --------------
A non-text attachment was scrubbed...
Name: one_utf-8_transaction.ofx
Type: application/octet-stream
Size: 1264 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20120201/4fdb2a8f/attachment.obj>


More information about the KMyMoney-devel mailing list