[bt-devel] NET Bible Unlock Bug
Eeli Kaikkonen
eekaikko at mail.student.oulu.fi
Thu Sep 27 03:15:41 MST 2007
On Wed, 26 Sep 2007, Jeremy Erickson wrote:
> As I posted on the wiki, I found a bug in the port of BibleTime to KDE 4
> which it turns out is also present in the current KDE 3 version. When I
> start BibleTime, it prints a message, "WARNING: Unlock key of module NET is
> not valid." However, it is nonetheless possible to use the module as if
> there was no problem. I found out that the message is being printed from
> line 178 in src/backend/drivers/cswordmoduleinfo.cpp when it encounters a
> nonprinting character in the text of Genesis 1. It does in fact decrypt the
> text properly, but some Hebrew characters (the name "Elohim" in footnote 2 of
> 1:1) are represented improperly in the QString and as such test as
> nonprinting characters.
> This causes the test for a proper unlocking to fail.
> I think the root cause is using fromLatin1() when the text itself was not
> encoded in Latin 1.
I think not. The problem may be that QChar::isPrint is not suitable for
single byte raw characters, only for real utf characters. In UTF8 the
characters in ascii range are in one byte, others in more than one byte.
I bet isPrint handles one byte which is not ascii as belonging to class
Cn. You could test this by printing the category of each character.
> Would there be a simple fix to make sure the text
> encoding is handled properly? I think this would be sufficient to fix the
> bug. Alternatively, would there be a cleaner way to check for unlocking?
Something cleaner would be better. I don't know how the crypting works.
It might be possible that even encrypted text has only printable
characters in some sections. If that is the case then this test gives
false positive.
Yours,
Eeli Kaikkonen (Mr.), Oulu, Finland
e-mail: eekaikko at mailx.studentx.oulux.fix (with no x)
More information about the bt-devel
mailing list