[reportlab-users] Encoding UTF-8 instead of PDFDoc
nomura at agic.cc
Wed Mar 1 00:05:20 EST 2017
pdfdocEnc() in pdfdoc.py raises a UnicodeEncodeError as below when I
process a PDF file with Unicode characters. I'm running my script on Python
UnicodeEncodeError: 'charmap' codec can't encode character '\x00' in
position 11: character maps to <undefined>
This error disappears when I change the encoding from extpdfdoc to utf-8 in
this block of code.
return x.encode('extpdfdoc') if isinstance(x,str) else x
While I don't fully understand 'extpdfdoc' encoding, can we change this
encoding to utf-8 as PDF specifications allow to use Unicode as well as
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the reportlab-users