i have a txt file containing a tick-marked list as so
Done List
☑ grocery
☑ electronics
The list above is created using Python like so:
chkbx = u"\u2611" #u'\U0001F5F9'
for ...
with open('List.txt','a',encoding='utf-8') as f:
f.write(f"{chkbx} {activity}\n")
I would like to convert the txt file into PDF using the FPDF
library for python. I use the following command to save
pdf.output('list.pdf').encode('utf-8')
and get the following Error:
UnicodeEncodeError: 'latin-1' codec can't encode character '\u2611' in position 516: ordinal not in range(256)
According to https://pyfpdf.readthedocs.io/en/latest/Unicode/index.html it should work (?) What am I missing here?