Re: What's wrong with my OFX file?

Benoit GrĂ©goire <[email protected]> Tue, 20 Mar 2012 23:39:01 -0400
Newsgroups gmane.comp.finance.libofx.devel
Organization Technologies Coeus inc.
Message-ID <34173351.v9HqjQxWrS@benoitg-t510>
--===============8223253112698874877==
Content-Type: multipart/alternative; boundary="nextPart3953503.TkE4O8II8r"
Content-Transfer-Encoding: 7Bit


--nextPart3953503.TkE4O8II8r
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="utf-8"

On March 21, 2012 12:52:03 AM Mat=C4=9Bj Cepl wrote:
> Hi,
>=20
> I am trying to write a plugin for ofxstatement script to import
> statements from my bank (Postal Savings Bank in Prague, Czech republi=
c).
> I have now here slightly modified version of the OFX document
> http://mcepl.fedorapeople.org/tmp/HIST_211202112_201203181608.ofx. Wi=
th
> ofxdump from libofx-0.9.4-3.el6.x86_64 I get plenty of errors on stde=
rr like
>=20
> (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
>=20
> and ofxdump produces corrupted characters. When importing this file i=
nto
> Gnucash I get corrupted characters as well (see
> http://mcepl.fedorapeople.org/tmp/gnucash-corrupted-encoding.png for =
a
> screenshot).
>=20
> Author of ofxstatement (put to CC of this email) suggested to replace=

> the top of the file with
>=20
> <!--
> OFXHEADER:100
> DATA:OFXSGML
> VERSION:102
> SECURITY:NONE
> ENCODING:UNICODE
> CHARSET:UTF-8
> COMPRESSION:NONE
> OLDFILEUID:NONE
> NEWFILEUID:NONE
> -->
> <OFX>
> [...]
>=20
> but although ofxdump was then able to read it correctly, gnucash stil=
l
> imports corrupted text in both payee and memo fields.
>=20
> Any ideas, what's wrong with my OFX document?

Nothing is wrong with your OFX document.  There were problems with OFX =
2.0 =20
support in libofx which were discovered and fixed in git a only a few w=
eeks ago=20
(OFX 2.0 is still aparently pretty rare in the wild).  The fixes will b=
e in the=20
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
cd libofx
./autogen.sh
make
sudo make install

Or run a git snapshot.  For ubuntu that would be found at: =20
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

--=20
Benoit Gr=C3=A9goire, ing., PMP, PSM
--nextPart3953503.TkE4O8II8r
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/=
REC-html40/strict.dtd">
<html><head><meta name=3D"qrichtext" content=3D"1" /><style type=3D"tex=
t/css">
p, li { white-space: pre-wrap; }
</style></head><body style=3D" font-family:'Sans Serif'; font-size:9pt;=
 font-weight:400; font-style:normal;">
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">On =
March 21, 2012 12:52:03 AM Mat=C4=9Bj Cepl wrote:</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; Hi,</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; </p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; I am trying to write a plugin for ofxstatement script to import</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; statements from my bank (Postal Savings Bank in Prague, Czech republi=
c).</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; I have now here slightly modified version of the OFX document</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; http://mcepl.fedorapeople.org/tmp/HIST_211202112_201203181608.ofx. Wi=
th</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; ofxdump from libofx-0.9.4-3.el6.x86_64 I get plenty of errors on stde=
rr like</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; </p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; (Above message occured on Line 48, Column 21)</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; LibOFX ERROR: OpenSP parser: otherError (misc parse error):</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; /tmp/libofxtmpWNlNLz:48:21:E: non SGML character number 173</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; </p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; and ofxdump produces corrupted characters. When importing this file i=
nto</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; Gnucash I get corrupted characters as well (see</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; http://mcepl.fedorapeople.org/tmp/gnucash-corrupted-encoding.png for =
a</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; screenshot).</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; </p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; Author of ofxstatement (put to CC of this email) suggested to replace=
</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; the top of the file with</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; </p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; &lt;!--</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; OFXHEADER:100</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; DATA:OFXSGML</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; VERSION:102</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; SECURITY:NONE</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; ENCODING:UNICODE</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; CHARSET:UTF-8</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; COMPRESSION:NONE</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; OLDFILEUID:NONE</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; NEWFILEUID:NONE</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; --&gt;</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; &lt;OFX&gt;</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; [...]</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; </p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; but although ofxdump was then able to read it correctly, gnucash stil=
l</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; imports corrupted text in both payee and memo fields.</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; </p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">&gt=
; Any ideas, what's wrong with my OFX document?</p>
<p style=3D"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px=
; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0p=
x; ">&nbsp;</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Not=
hing 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 f=
ixes will be in the upcoming 0.9.6 (and I checked that your file works =
fine).</p>
<p style=3D"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px=
; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0p=
x; ">&nbsp;</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">For=
 now you'd need to compile directly from git:</p>
<p style=3D"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px=
; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0p=
x; ">&nbsp;</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">git=
 clone <span style=3D" font-family:'Courier New,courier';">git://libofx=
.git.sourceforge.net/gitroot/libofx/libofx</span></p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><sp=
an style=3D" font-family:'Courier New,courier';">cd libofx</span></p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><sp=
an style=3D" font-family:'Courier New,courier';">./autogen.sh</span></p=
>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><sp=
an style=3D" font-family:'Courier New,courier';">make</span></p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><sp=
an style=3D" font-family:'Courier New,courier';">sudo make install</spa=
n></p>
<p style=3D"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px=
; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0p=
x; ">&nbsp;</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><sp=
an style=3D" font-family:'Courier New,courier';">Or run </span>a git sn=
apshot.  For ubuntu that would be found at:  https://launchpad.net/~ben=
oitg/+archive/libofx-daily, and can be added with</p>
<p style=3D"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px=
; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0p=
x; ">&nbsp;</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">sud=
o apt-add-repository ppa:benoitg/libofx-daily</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">sud=
o apt-get update</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">sud=
o apt-get install ofx</p>
<p style=3D"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px=
; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0p=
x; ">&nbsp;</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">-- =
</p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Ben=
oit Gr=C3=A9goire, ing., PMP, PSM</p></body></html>
--nextPart3953503.TkE4O8II8r--



--===============8223253112698874877==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
--===============8223253112698874877==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Libofx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libofx-devel

--===============8223253112698874877==--