Do you know about the codecs module? reading http://pymotw.com/2/codecs/ may be useful if this is new to you.
Have you read https://www.python.org/dev/peps/pep-0293/ ? Will backslashreplace do what you want? Laura -- https://mail.python.org/mailman/listinfo/python-list