Use surrogateescape in python3.