Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 04-26-2013, 02:26 AM   #541
steppe
Enthusiast
steppe began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Jun 2012
Device: Kindle 4 NT (broke), Kindle Paperwhite, Kindle 2
Hi. thanks for the update.
steppe is offline   Reply With Quote
Old 04-27-2013, 02:15 AM   #542
dimasic
Enthusiast
dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'
 
Posts: 43
Karma: 10000
Join Date: Apr 2013
Device: Kindle 4NT
Thanks for great handy tool.

But there's a problem. Windows 7 x32, KindleUnpack 0.61, 0.62 From GUI shell the tool works perfectly, but when it is started from command line AND filename contains cyrillic symbols, it says that "'utf8' codec can't decode byte 0xcb in position 0: invalid continuation byte". Renamed with latin characters file will be unpacked pretty well, so the problem only with filename handling. Is it possible to do something with it?
dimasic is offline   Reply With Quote
Old 04-27-2013, 09:44 PM   #543
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,506
Karma: 5433350
Join Date: Nov 2009
Device: many
Hi,
Even in command line mode, kindleunpack makes calls to get the command line using Windows Wide calls to get a full unicode version of all arguments, which it then converts to utf-8 internally. So I am surprised you are having trouble. What shell and what encoding are you using to invoke the command line? Are you by any chance using a bat file? If so you will need to use cp65001 on the same line you use to invoke kindleunpack.

Thanks,

KevinH

Quote:
Originally Posted by dimasic View Post
Thanks for great handy tool.

But there's a problem. Windows 7 x32, KindleUnpack 0.61, 0.62 From GUI shell the tool works perfectly, but when it is started from command line AND filename contains cyrillic symbols, it says that "'utf8' codec can't decode byte 0xcb in position 0: invalid continuation byte". Renamed with latin characters file will be unpacked pretty well, so the problem only with filename handling. Is it possible to do something with it?
KevinH is offline   Reply With Quote
Old 04-28-2013, 01:37 AM   #544
dimasic
Enthusiast
dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'
 
Posts: 43
Karma: 10000
Join Date: Apr 2013
Device: Kindle 4NT
The command line codepage is cp866, the shell is cmd.exe. As I said, when invoking from command line / bat file, it gets the error. Even if the directory path of the MOBI file contains cyrillic, but the filename itself in latin chars, then it's all OK. Is it necessary to convert filename? For example, the kindlestrip tool, written on python too, works well. Without conversion or something like that.
dimasic is offline   Reply With Quote
Old 04-28-2013, 01:17 PM   #545
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,506
Karma: 5433350
Join Date: Nov 2009
Device: many
Hi,
You should just be able to fix your bat file to change to cp65001 on the same line you invoke kindleunpack.py

Something similar to the following should work in your bat file

Code:
chcp 65001 > nul && start /min python kindleunpack.py %*
The problem is without the chcp 65001, python will default to mbcs codec that can not represent all chars from every language and some chars then get mangled inside the python interpreter before ever reaching this program.

Changing to utf-8 (cp-65001) first allows all chars from every language to be represented and properly passed to Windows so hat Windows wide calls can be made to get all arguments.

Please give something similar to this a try and you should be able to get the command line to work properly on Windows. If not, enable debug mode from the command line and post a full debug output here in case the problem is occurring someplace other than right at the command line interface.

Please let me know the result.

Thanks,

KevinH

Quote:
Originally Posted by dimasic View Post
The command line codepage is cp866, the shell is cmd.exe. As I said, when invoking from command line / bat file, it gets the error. Even if the directory path of the MOBI file contains cyrillic, but the filename itself in latin chars, then it's all OK. Is it necessary to convert filename? For example, the kindlestrip tool, written on python too, works well. Without conversion or something like that.
KevinH is offline   Reply With Quote
Old 04-28-2013, 02:01 PM   #546
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,506
Karma: 5433350
Join Date: Nov 2009
Device: many
Hi,

You are right it is a bug. In kindleunpack.py, near the end of the file, you will see the following code block:


Code:
    argv=utf8_argv()
    progname = os.path.basename(argv[0])
    try:
        opts, args = getopt.getopt(sys.argv[1:], "hdrs")
    except getopt.GetoptError, err:
        print str(err)
        usage(progname)
        sys.exit(2)

    if len(args)<1:
        usage(progname)
        sys.exit(2)

    for o, a in opts:
        if o == "-d":
            DUMP = True
        if o == "-r":
            WRITE_RAW_DATA = True
        if o == "-s":
            SPLIT_COMBO_MOBIS = True
        if o == "-h":
            usage(progname)
            sys.exit(0)

    if len(args) > 1:
        infile, outdir = args
    else:
        infile = args[0]
Please change this line:
Code:
opts, args = getopt.getopt(sys.argv[1:], "hdrs")
To look like this and see if that fixes your issue?
Code:
opts, args = getopt.getopt(argv[1:], "hdrs")
So that it will get the utf-8 encoded command line and not the python broken internal sys.argv command line.

Hope this fixes the issue!

Thanks,

KevinH

Last edited by KevinH; 04-28-2013 at 02:07 PM.
KevinH is offline   Reply With Quote
Old 04-28-2013, 03:52 PM   #547
dimasic
Enthusiast
dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'dimasic knows the difference between 'who' and 'whom'
 
Posts: 43
Karma: 10000
Join Date: Apr 2013
Device: Kindle 4NT
Oh, thank you! Now it works with any symbol set.
dimasic is offline   Reply With Quote
Old 04-28-2013, 07:15 PM   #548
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,506
Karma: 5433350
Join Date: Nov 2009
Device: many
Hi,

Thanks for letting me know that did the trick. I will include it in the next update but that may be a while away since neither the gui nor the calibre plugin uses the command line interface.

Take care,

Kevin
KevinH is offline   Reply With Quote
Old 06-17-2013, 12:41 PM   #549
MastroMicio
Junior Member
MastroMicio began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jun 2013
Device: ipad,kindle
Hi,

I have a problem with the KindleUnpack/MobiUnpack drag&drop applescript. The mobi file I'd like to unpack is a custom-made non-drm book I create with kindlegen from an ePub file. The problem is that if I drag the mobi file over the MobiUnpack applescript and drop it, I can see the script opening and closing on the dock but no folder appears close to the mobi file. Isn't the folder of the unpacked book supposed to appear in the same folder the two files are? Am I doing something wrong? I was used to use those scripts while ago and maybe I forgot how to use them properly (or maybe they don't work on the last OSX?..btw I have OSX 10.8.4).

Thanks in advance to everyone. Sorry for bothering you with my issues.
MastroMicio is offline   Reply With Quote
Old 06-17-2013, 01:14 PM   #550
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,506
Karma: 5433350
Join Date: Nov 2009
Device: many
Hi,

Try simply double-clicking on that applescript (instead of dragging and dropping something on it) and see if it allows you to set or change preferences. Perhaps there is a preference where you tell it where to put the unpacked files? I am not too sure but Paul will know for sure.

If not, then it may be a bug in KindleUnpack somehow? You can try running it via the command line or by simply double-clicking the KindleUnpack.pyw app and following along. Once there you can see a log file and turn on debug and raw flags so that we can see what is happening.

Thanks,

KevinH

Quote:
Originally Posted by MastroMicio View Post
Hi,

I have a problem with the KindleUnpack/MobiUnpack drag&drop applescript. The mobi file I'd like to unpack is a custom-made non-drm book I create with kindlegen from an ePub file. The problem is that if I drag the mobi file over the MobiUnpack applescript and drop it, I can see the script opening and closing on the dock but no folder appears close to the mobi file. Isn't the folder of the unpacked book supposed to appear in the same folder the two files are? Am I doing something wrong? I was used to use those scripts while ago and maybe I forgot how to use them properly (or maybe they don't work on the last OSX?..btw I have OSX 10.8.4).

Thanks in advance to everyone. Sorry for bothering you with my issues.
KevinH is offline   Reply With Quote
Old 06-17-2013, 05:13 PM   #551
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 71,406
Karma: 305065800
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
Quote:
Originally Posted by MastroMicio View Post
Hi,

I have a problem with the KindleUnpack/MobiUnpack drag&drop applescript. The mobi file I'd like to unpack is a custom-made non-drm book I create with kindlegen from an ePub file. The problem is that if I drag the mobi file over the MobiUnpack applescript and drop it, I can see the script opening and closing on the dock but no folder appears close to the mobi file. Isn't the folder of the unpacked book supposed to appear in the same folder the two files are? Am I doing something wrong? I was used to use those scripts while ago and maybe I forgot how to use them properly (or maybe they don't work on the last OSX?..btw I have OSX 10.8.4).

Thanks in advance to everyone. Sorry for bothering you with my issues.
My guess would be security settings. Try running the AppleScript by just double-clicking it. You should get an information dialog. If you get a warning that you can't run this application because of your security settings, hold down the control key and double-click it again. That should give you an option to open it anyway.
pdurrant is offline   Reply With Quote
Old 06-21-2013, 09:42 AM   #552
MastroMicio
Junior Member
MastroMicio began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jun 2013
Device: ipad,kindle
Problem solved!
Thank you sooooooo much!! You guys are life savers!
MastroMicio is offline   Reply With Quote
Old 07-17-2013, 12:44 AM   #553
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Hello again!

I'm still using a stripped down KindleUnpack in the Kindle ScreenSavers hack, and one user just ran into a weird thing: a JPEG file with no EXIF or JFIF header, used as the cover.

imghdr doesn't handle those, so it gets discarded as an unknown resource. FWIW, GIMP chokes on it too, but ImageMagick handles it fine. Since I'm using IM, I amended the imghdr check with another one, right after:

Code:
                # imghdr only checks for JFIF or Exif JPEG files. Apparently, there are some with only the magic JPEG bytes out there... ImageMagick handle those, so, do it too.
                if imgtype is None and data[0:2] == chr(0xFF) + chr(0xD8):
                    imgtype = "jpeg"
Has anyone ever encountered JPEG files like that before?

Last edited by NiLuJe; 07-17-2013 at 12:49 AM.
NiLuJe is offline   Reply With Quote
Old 07-17-2013, 12:46 AM   #554
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://github.com/kovidgoyal/calibr...tils/imghdr.py
kovidgoyal is offline   Reply With Quote
Old 07-17-2013, 01:31 AM   #555
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Ha ! Should have checked Calibre ;-)

Thanks !
NiLuJe is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can i rotate text and insert images in Mobi and EPUB? JanGLi Kindle Formats 5 02-02-2013 04:16 PM
PDF to Mobi with text and images pocketsprocket Kindle Formats 7 05-21-2012 07:06 AM
Mobi files - images DWC Introduce Yourself 5 07-06-2011 01:43 AM
pdf to mobi... creating images rather than text Dumhed Calibre 5 11-06-2010 12:08 PM
Transfer of images on text files anirudh215 PDF 2 06-22-2009 09:28 AM


All times are GMT -4. The time now is 07:27 PM.


MobileRead.com is a privately owned, operated and funded community.