|
I have a html, which has a CSS style contains CJK font-face. I received the following errors with html2epub:
Traceback (most recent call last):
File "/usr/bin/html2epub", line 8, in <module>
load_entry_point('calibre==0.4.100', 'console_scripts', 'html2epub')()
File "/usr/lib/python2.5/site-packages/calibre/ebooks/epub/from_html.py", line 320, in main
convert(args[1], opts)
File "/usr/lib/python2.5/site-packages/calibre/ebooks/epub/from_html.py", line 261, in convert
parse_content(filelist, opts, tdir)
File "/usr/lib/python2.5/site-packages/calibre/ebooks/epub/from_html.py", line 121, in parse_content
hp.save()
File "/usr/lib/python2.5/site-packages/calibre/ebooks/epub/from_html.py", line 93, in save
Processor.save(self)
File "/usr/lib/python2.5/site-packages/calibre/ebooks/html.py", line 579, in save
open(path, 'wb').write(getattr(sheet, 'cssText', sheet).encode('utf-8'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 34: ordinal not in range(128)
The result of self.log_info('attr=%s' % getattr(sheet, 'cssText', sheet) is:
attr=.calibre_class_2 {
font-face: 楷体_GB2312
}
.calibre_class_3 {
color: #ff0000
}
.calibre_class_0 {
color: #000000
}
|