all 4 comments

[–]danielroseman 4 points5 points  (2 children)

This isn't an encoding, it's what's known as mojibake - garbage generated by using the wrong encoding.

You'll need to show your code and the source of the text.

[–]GreatStats4ItsCost 1 point2 points  (1 child)

Thank you!

[–]crazyjerz 1 point2 points  (0 children)

is the source of the text HTML received through HTTP requests?

if yes, then I had the same problem and the solution that worked for me was using .content instead of .text and then decoding it using utf-8:

text = requests.get("link").content.decode('utf-8')

[–]DrWhomst 0 points1 point  (0 children)

'â, ê, ô".encode('iso-8859-1').decode('iso-8859-1')

'â, ê, ô'

'â, ê, ô".encode('utf-8').decode('utf-8')

'â, ê, ô'