Convert non-ascii character to ascii character

Viewed 340

I'm looking for convert this string :

test = "Il était toujours temps d’étouffer l’inflation par la hausse des taux"

to this:

test = "Il était toujours temps d'étouffer l'inflation par la hausse des taux"

I mean replace the non ascii character by "real" words/letters.

1 Answers
test.encode('cp1252').decode('utf-8')

I've tried this and it works. I took it from here

Related