![]() |
#1 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 89
Karma: 19669
Join Date: Apr 2012
Device: Kindle Touch
|
Can't match Unicode character
In the good old days when men were men and characters were single bytes, humble ASCII had just two quotes: single (') and double ("). Now we have opening and closing, single and double, low and up, with and without angle, normal and heavy, reversed or not, and their respective combinations. Some of them make recipes fail with the following error:
Code:
UnicodeEncodeError: 'charmap' codec can't encode character u'\u201c' in position 30: character maps to <undefined> Code:
,(re.compile(u'\u201c'), lambda match: '“') # left double quotation mark I attach my failed recipe (as a zip to preserve UTF-8) in the hope that somebody can solve it. TIA. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,279
Karma: 27111060
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Try setting encoding to different values in your recipe. utf8, latin1, cp1252, cp1251 are popular.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 89
Karma: 19669
Join Date: Apr 2012
Device: Kindle Touch
|
Thanks for the suggestion, but the page really uses UTF-8. Setting the encoding to other values just adds garbage chars in the text.
I'm afraid this may require more complex solutions. I'll have a look at builtin recipes for more inspiration and report back when/if I make any progress. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with Unicode Character 'Word Joiner' (U+2060) | psztk | Conversion | 0 | 10-14-2011 01:18 PM |
how to have regex dot match any character including newline? | gnychis | Calibre | 5 | 11-30-2010 06:35 PM |
Glyph Substitution of Unicode character | vdevan | OpenInkpot | 2 | 07-18-2009 05:54 PM |
eReader to match Amazon... more is always better! | Ceili | News | 18 | 07-01-2009 11:11 AM |
SonyStyle Price Match | Zen-Diego | Sony Reader | 3 | 05-06-2009 03:07 PM |