Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Date: 2019.11.14 Stackoverflow: How can I convert encoding of special characters in python?

Problem with ä å Ä

Text has strange ä å Ä . Probably it was MacOS system.

Is there an outdoor grill/bbq place? P√§r

Hej Hur långt aaär de till Stallarna? MVH LAILA

Är där sandstrand och hur långt

It used MAcRoman instead of UTF-8 to decode it.

So it need to be encoded to bytes with MAcRoman and decoded back to string with utf-8

print( text.encode('MacRoman').decode('utf-8') )

Links: How to decode these characters? á é í