codecs for Python 2 Posted on 2017-04-10 Edited on 2022-02-24 123456789# Handling Unicode: http://stackoverflow.com/a/6633040/305414import sysif sys.version < '3': import codecs def u(x): return codecs.unicode_escape_decode(x)[0]else: def u(x): return x Still search for the documentation for the function unicode_escape_decode() in codecs.