Gnucash and utf-8 : summary

Didier Vidal didier-devel at
Sun Sep 25 17:11:37 EDT 2005

Le dim 25/09/2005 à 22:53, Derek Atkins a écrit :
> Quoting Didier Vidal <didier-devel at>:
> [snip]
> Good to hear the tests worked.  That bodes well.
> > But maybe one could add a unit test in gnucash that opens a gnucash file
> > with non ascii parameters, and checks that the objects are built
> > properly. The test could even save the file and read it again, to check
> > that there is no alteration in the loop.
> Unfortunately this wont work..  There's no guarantee of ordering during 
> save. It's quite possible that a Load/Save sequence (without any other 
> changes to the
> data) will NOT necessarily produce the exact same bit-for-bit version of the
> datafile.  The objects could have a different order within the XML 
> document. So, this kind of comparison can't be done (easily).
I was not thinking of making a diff two the files. Even if the order was
the same, libxml may produce changes (for instance escaping or not a
char). I was thinking of checking the gnucash objects re-read from the

pseudo code:
for each test file (you could cover various initial encodings) {
   read the file
   check object's values (for instance account names) check that they
are read as expected
   save the file (in a different location of course, to keep the master
test file clean)
   read the saved file
   check the object's values

> > Didier.
> -derek

More information about the gnucash-devel mailing list