-
Notifications
You must be signed in to change notification settings - Fork 331
Closed
Description
When I try to use python-pdfkit with certain HTML content that has certain characters in it, it fails with one of these errors if the html content is loaded into memory:
File ". . . /pdfkit.py", line 100, in to_pdf
input = self.source.to_s().encode('utf-8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 64: ordinal not in range(128)
or
File ". . ./pdfkit.py", line 102, in to_pdf
input = self.source.source.read().encode('utf-8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 64: ordinal not in range(128)
But, python pdfkit works just fine if it is provided with just a filename, and so does wkhtmltopdf.
I think that python pdfkit is doing something unsafe with strings; perhaps it should assume that the input is just bytes.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels