More Encoding Bugs in Bookcase

I’ve come across two more encoding bugs in Bookcase. This is tough stuff to get right. First, someone kindly sent me an email pointing out that the bookcase2bibtex.xsl stylesheet outputs in UTF-8 encoding. Evidently, this was unexpected, since the locale was still ISO-8859-1. I’m not sure if this is a bug, or just unexpected behavior. The encoding attribute of the xsl:output tag is only used for specifying the encoding of the output if the output is an XML document, near as I can tell.

Second, importing a Bibtexml file, which is in UTF-8 and has some “unusual” characters like German umlauts, results in the text being converted twice to ISO-8859-1 for some reason, which I can’t figure out. Both libxslt and Qt perform the recoding, resulting in wrong data. This one really has me puzzled…I can’t find anything in my code that would seem to cause it. The data file is read in by libxslt, run through the stylesheet, and then a QString is output. And I load that QString into my document. Hmmmm…