Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 01-23-2011, 08:23 AM   #1
cafedo
Junior Member
cafedo began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
Problem with ISO-8859-1 charset

I've done a recipe that download news from yahoo fees rss (Italy version).
It looks great on my kindle after an advanced scripting using calibre, but i've got a problem: if you look at the html of this example page
http://it.notizie.yahoo.com/35/20110...o-5101f32.html
you will found that the charset is "charset=ISO-8859-1".
So in my recipe I've added the script <encoding = 'iso-8859-1'>, but there are some error in characters, for example the string in the page "all’uscita" is translated to "all?uscita"; i also tried to use the scripts <encoding = 'utf8'>, <encoding = 'utf-8'> or to not insert the script <encoding> but the result is the same.
What encoding I've to use?

Could you help me please?
Thanks in advance.
cafedo is offline   Reply With Quote
Old 01-23-2011, 08:33 AM   #2
cafedo
Junior Member
cafedo began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
Wait a moment...

Now I've tried to use the encoding 'cp1252' and it seems that it has resolved my problem..
cafedo is offline   Reply With Quote
Advert
Old 01-24-2011, 06:13 PM   #3
cafedo
Junior Member
cafedo began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
Ok now the conversione with the GUI of calibre work, but if i try to do a conversion via MSDOS (I use windows versione of Calibre on Windows 7 SO) trought the command:

ebook-convert.exe myRecipe.recipe converted.mobi

program gives me this error:

1% Conversione dell'input in HTML...
InputFormatPlugin: Recipe Input running
Python function terminated unexpectedly
'utf8' codec can't decode byte 0xe0 in position 1766: invalid continuation byt
e (Error Code: 1)
Traceback (most recent call last):
File "site.py", line 103, in main
File "site.py", line 85, in run_entry_point
File "site-packages\calibre\ebooks\conversion\cli.py", line 278, in main
File "site-packages\calibre\ebooks\conversion\plumber.py", line 897, in run
File "site-packages\calibre\customize\conversion.py", line 204, in __call__
File "site-packages\calibre\web\feeds\input.py", line 68, in convert
File "site-packages\calibre\web\feeds\recipes\__init__.py", line 35, in compil
e_recipe
File "encodings\utf_8.py", line 16, in decode
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe0 in position 1766: invali
d continuation byte


and the conversion is stopped..
It's seem like that encoding rule 'cp1252' in recipe breaks something in ebook-convert.exe command.
Coul you help me please?

Carlo
cafedo is offline   Reply With Quote
Old 01-24-2011, 07:31 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: 43,851
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
you need to ensure that your .recipe file is saved in utf-8 encoding
kovidgoyal is offline   Reply With Quote
Old 01-25-2011, 04:14 AM   #5
cafedo
Junior Member
cafedo began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jan 2011
Device: Kindle 3
Thanks!
PsPad by default saves file in ANSI format; in utf8 works!

Last edited by cafedo; 01-25-2011 at 04:29 AM.
cafedo is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PDF is now an ISO Standard Bob Russell News 2 12-06-2007 01:00 PM


All times are GMT -4. The time now is 11:43 PM.


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