>>> teststring = \'aõ\' >>> type(teststring) >>> teststring \'a\\xf5\' >>> print teststring aõ >>> test
It's simple: .encode converts Unicode objects into strings, and .decode converts strings into Unicode.