I committed one of the cardinal sins of programming, it seems. The file truncation bug was due to an implicit assumption on my part that the number of characters in an XML stream was equal to the number of characters in the character array. For Unicode characters, of course this is not true, and so the xml stream was getting truncated. I don’t even remember thinking about it when I added the call to the KZip api. Alas.
I had some help from Michal Rudolf in tracking down the problem, and I appreciate that. It was exacerbated by the fact that there is no error recovery in XML and Qt’s DOM reader properly returns a NULL document when an error is encountered.
Bookcase 0.8.2 fixes the bug.
And as punishment, I promise to read The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) 20 times.