While reading file on Python, I got a UnicodeDecodeError. What can I do to resolve this?

Try:

enc="utf-8"
log = open('/Users/Owner/Desktop/Exodus Logs/DIRTYLOGS/serverlog_20130430_00.15.21.txt', 'r', encoding=enc)

if it won’t work try:

enc="utf-16"
log = open('/Users/Owner/Desktop/Exodus Logs/DIRTYLOGS/serverlog_20130430_00.15.21.txt', 'r', encoding=enc)

you could also try it with

enc="iso-8859-15"

also try:

enc="cp437"

wich is very old but it also has the “ü” at 0x81 wich would fit to the string “üßer” wich I found on the homepage of assault cube.

If all the codings are wrong try to contact some of the guys developing assault cube or as mentioned in a comment: have a look at https://pypi.python.org/pypi/chardet

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)