I'm trying to write an html but I have some problems with the characters encoding.
this is my description:
Samsung Galaxy Grand Prime Dual Sim Il Samsung Galaxy Grand Prime è uno smartphone Dual SIM Dual Standby con scocca monoblocco basato sul sistema operativo Android 4.4.2, con supporto alle reti UMTS/GSM e connettività [...]
but when I write it using
self.wfile.write(desc)
I receive this error
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1086: ordinal not in range(128)
The problem is with the à characters.
I need to find I way to encode it and pass to the function
I don't want to use something like
footer=footer.replace("à","a")
I need a general method that can works for all characters and if is possible the method must keep the accent.