0

I'm having the following error:

UnicodeEncodeError: 'latin-1' codec can't encode character '\u011f' in position 176: ordinal not in range(256)

for the following part:

text = "ğağağağağali"
text = textwrap.indent(text=text, prefix=' ')

d = "doc1.pdf"

thedocument.multi_cell(w=17, h=0.5, txt=text)
thedocument.output(d, 'F')

Problematic part of the code is given, summarized, would be so thankful if someone helps me out.

I tried to solve by adding text.encode('utf-8') to the code, but still didn't work out.

davidism
  • 121,510
  • 29
  • 395
  • 339

0 Answers0