I'm trying to decode the following:
UKLTD� For
into utf-8 (or anything really) but I cannot workout how to do it and keep getting errors like
'ascii' codec can't decode byte 0xae in position 8: ordinal not in range(128)
I'm reading from a csv and have the following:
with open(path_to_file, 'rb') as f:
reader = csv.reader(f)
for row in reader:
order = Order(
...
product_name = row[11].encode('utf-8'),
...
)
order.save()
I would be happy right now to just ignore the character if I have keep the rest of the string.
Thank you to @BartFriederichs.
Solution is :
product_name = row[11].decode('iso-8859-1').encode('utf8')