View Single Post
Old 02-24-2009, 12:02 AM   #1
nsg
Member
nsg began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Nov 2007
Device: PRS-505
how to add encoding?

When I start rtf2lrf with
rtf2lrf (calibre 0.4.130)

rtf2lrf --encoding=cp-1251 --keep-intermediate-files z.rtf

It says

Converting XML to HTML...
Traceback (most recent call last):
File "c:\Program Files\calibre\library.zip\calibre\customize\ui.py" , line 127,
in get_file_type_metadata
File "calibre\customize\builtins.pyo", line 68, in get_metadata
File "c:\Program Files\calibre\library.zip\calibre\ebooks\lrf\meta. py", line 2
23, in get_metadata
File "c:\Program Files\calibre\library.zip\calibre\ebooks\lrf\meta. py", line 4
42, in __init__
LRFException: D:\lib\!ebook\z\z.rtf has an invalid LRF header. Are you sure it i
s an LRF file?
Processing u'index.html'
Traceback (most recent call last):
File "convert_from.py", line 189, in <module>
File "convert_from.py", line 85, in main
File "convert_from.py", line 69, in process_file
File "c:\Program Files\calibre\library.zip\calibre\ebooks\lrf\html\ convert_fro
m.py", line 1922, in process_file
File "c:\Program Files\calibre\library.zip\calibre\ebooks\lrf\html\ convert_fro
m.py", line 277, in __init__
File "c:\Program Files\calibre\library.zip\calibre\ebooks\lrf\html\ convert_fro
m.py", line 385, in add_file
LookupError: unknown encoding: cp-1251

What's missing for cp-1251 encoding and where I can get it?
What file is it looking for and can I create it myself (assuming I know the relation between cp-1251 codepoints and unicode, but do not know python)?

Thank you.
nsg is offline   Reply With Quote