mobiunpack icon indicating copy to clipboard operation
mobiunpack copied to clipboard

UTF-8 error?!

Open lumanz opened this issue 14 years ago • 4 comments

Hi, I used mobiunpack.py to get the html file. And then I put it back to Mobipocket Creator. It turns out the error: source file is not valid utf8.

I opened the html file I got and found many lines like this:

<idx:orth value="NUL ETX NUL EOT NUL...

which doesn't seems like a normal html. I think there's something wrong when you insert the meta back.

Could you pls have a look at this?

Regards.

lumanz avatar Dec 17 '11 14:12 lumanz

If you see orth entries I assume your mobipocket file is a dictionary. What dictionary is it (languages)?

I know that the dictionary handling code in mobiunpack.py has issues if the source language uses utf-8. If someone comes up with a fix I'll be happy to include it.

Ciao, Steffen

siebert avatar Dec 17 '11 15:12 siebert

Yes, it's a English2Chinese dictionary. Actually, all I want is to change the input language, so I can look up English words in books that Language meta is zh-cn or books with both Chinese and English.

So is it possible to change the meta directly without decoding?

Thank you very much!

lumanz avatar Dec 17 '11 15:12 lumanz

You should be able to change the metadata of the dictionary with mobi2mobi from the mobiperl tools (https://dev.mobileread.com/trac/mobiperl)

Ciao, Steffen

siebert avatar Dec 17 '11 15:12 siebert

Yes, I have given that a try and failed. [?]

96 0x60 4 Input Language Input language for a dictionary 100 0x64 4 Output Language Output language for a dictionary Here are the offset of the content. And the mobi2mobi tool can't change it.

I'm wondering if I can use something like winhex to change it. Or, it is impossible to change it without decoding the mobi file.

Thanks again!

2011/12/17 siebert < [email protected]

You should be able to change the metadata of the dictionary with mobi2mobi from the mobiperl tools ( https://dev.mobileread.com/trac/mobiperl)

Ciao, Steffen


Reply to this email directly or view it on GitHub: https://github.com/siebert/mobiunpack/issues/1#issuecomment-3189766

lumanz avatar Dec 17 '11 15:12 lumanz