View Single Post
Old 10-24-2011, 11:57 AM   #425
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Quote:
Originally Posted by DiapDealer View Post
I'm just not sure. The source (for the most recent version of calibre) that writes the Palmdoc header seems pretty straightforward and would appear to always create a database name that is 32 characters or less and null terminated.
Code:
title = str(self._oeb.metadata.title[0])
title = re.sub('[^-A-Za-z0-9]+', '_', title)[:31]
title = title + ('\0' * (32 - len(title)))
So either:
A) something screwy is happening in calibre that causes the null termination to fail on longer titles.

B) mobi2mobi doesn't think the string is null terminated for some reason.

To be perfectly honest... neither seem very likely to me. I'm a little stymied.
Just look at the example file and see if there is a 0 at position 32 or less.

Maybe the title contains unicode characters?
tompe is offline   Reply With Quote