Alan CUZON
Alan CUZON

Reputation: 23

Convert non-ascii character to ascii character

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.

Upvotes: 1

Views: 1689

Answers (1)

domiziano
domiziano

Reputation: 470

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

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

Upvotes: 2

Related Questions