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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-25-2008, 03:26 AM   #1
Dave Berk
Fanatic
Dave Berk can fool all of the people all of the time.Dave Berk can fool all of the people all of the time.Dave Berk can fool all of the people all of the time.Dave Berk can fool all of the people all of the time.Dave Berk can fool all of the people all of the time.Dave Berk can fool all of the people all of the time.Dave Berk can fool all of the people all of the time.Dave Berk can fool all of the people all of the time.Dave Berk can fool all of the people all of the time.Dave Berk can fool all of the people all of the time.Dave Berk can fool all of the people all of the time.
 
Dave Berk's Avatar
 
Posts: 578
Karma: 138556
Join Date: May 2006
Device: PRS505
Conversion errors (encoding?)

Trying to convert an html file, I get the following exception:

Code:
Job: **Convert book: ###############** **tuple**: ('ValueError', u'unichr() arg not in range(0x10000) (narrow Python build)') **Traceback**: Traceback (most recent call last): File "parallel.py", line 928, in worker File "parallel.py", line 886, in work File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\any\convert_from.py", line 192, in main File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\any\convert_from.py", line 162, in process_file File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\html\convert_from.py", line 1918, in process_file File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\html\convert_from.py", line 273, in __init__ File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\html\convert_from.py", line 387, in add_file File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\html\convert_from.py", line 330, in preprocess File "calibre\ebooks\BeautifulSoup.pyo", line 1432, in __init__ File "calibre\ebooks\BeautifulSoup.pyo", line 1055, in __init__ File "calibre\ebooks\BeautifulSoup.pyo", line 1084, in _feed File "calibre\__init__.pyo", line 382, in entity_to_unicode ValueError: unichr() arg not in range(0x10000) (narrow Python build) **Log**: Processing u'calibre_0.4.106_f8it75.html' Parsing HTML... ('ValueError', u'unichr() arg not in range(0x10000) (narrow Python build)') Traceback (most recent call last): File "parallel.py", line 928, in worker File "parallel.py", line 886, in work File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\any\convert_from.py", line 192, in main File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\any\convert_from.py", line 162, in process_file File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\html\convert_from.py", line 1918, in process_file File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\html\convert_from.py", line 273, in __init__ File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\html\convert_from.py", line 387, in add_file File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\html\convert_from.py", line 330, in preprocess File "calibre\ebooks\BeautifulSoup.pyo", line 1432, in __init__ File "calibre\ebooks\BeautifulSoup.pyo", line 1055, in __init__ File "calibre\ebooks\BeautifulSoup.pyo", line 1084, in _feed File "calibre\__init__.pyo", line 382, in entity_to_unicode ValueError: unichr() arg not in range(0x10000) (narrow Python build)
The source encoding (according to the html meta) is Latin-1 (ISO-8859-1). Anybody knows what causing this error?
Dave Berk is offline   Reply With Quote
Old 11-25-2008, 01:03 PM   #2
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: 25,912
Karma: 5035037
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
This is caused byt he HTML file having numerical entities with numbers that are not valid in the specified encoding. Numerical entites are of the form &1234; or &x1234; Where the numbers could be anything
kovidgoyal is offline   Reply With Quote
 
Enthusiast
Old 11-25-2008, 02:11 PM   #3
Dave Berk
Fanatic
Dave Berk can fool all of the people all of the time.Dave Berk can fool all of the people all of the time.Dave Berk can fool all of the people all of the time.Dave Berk can fool all of the people all of the time.Dave Berk can fool all of the people all of the time.Dave Berk can fool all of the people all of the time.Dave Berk can fool all of the people all of the time.Dave Berk can fool all of the people all of the time.Dave Berk can fool all of the people all of the time.Dave Berk can fool all of the people all of the time.Dave Berk can fool all of the people all of the time.
 
Dave Berk's Avatar
 
Posts: 578
Karma: 138556
Join Date: May 2006
Device: PRS505
Quote:
Originally Posted by kovidgoyal View Post
This is caused byt he HTML file having numerical entities with numbers that are not valid in the specified encoding. Numerical entites are of the form &1234; or &x1234; Where the numbers could be anything
Thanks for answering.

There are, indeed, quite a few of these spread throughout the file, but Opera and FF reads it just fine.
How do I change it? Is there a program that will convert it for me to some other encoding?
Dave Berk is offline   Reply With Quote
Old 11-25-2008, 02:23 PM   #4
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: 25,912
Karma: 5035037
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
open a ticket and attach the file
kovidgoyal 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
Encoding prusaks Recipes 0 09-27-2010 06:25 AM
Calibre Conversion Errors mrbillb Calibre 16 09-10-2010 11:21 PM
Conversion to Mobi to ePub errors erik_reader Conversion 5 08-07-2010 02:03 AM
Calibre conversion errors? nick_f Sony Reader 2 03-03-2009 05:44 AM
encoding errors in feeds under the new release alexxxm Calibre 2 11-26-2008 12:44 PM


All times are GMT -4. The time now is 08:09 AM.


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