surrogateescape for python3, fixes #190

also compatiable with python2 cause it just ignore it.