View Single Post
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,643
Karma: 5433388
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