I want to convert an html page to pdf. For that, I access data from excel and store it in a python dictionary. After that I format the string like below.
Write python variables data into file:
html_file.write( html_rcc_string%(row["B_6.2OwnerName"],
row["B_6.3OwnerNameH"],))
In the above code html_rcc_string
contains html code, i.e.
<table>
<tr>
<td>Owner name</td>
<td>Owner name in hindi</td>
</tr>
<tr>
<td>%s</td>
<td>%s</td>
</tr>
</table>
When I supply a dictionary variable which has a name in Hindi, it returns the below error.
UnicodeEncodeError: 'ascii' codec can't encode characters in position 4273-4279: ordinal not in range(128)
I googled for this but I did not find anything. How can I display user name in Hindi? Any suggestions?