For example, if I have a unicode string, I can encode it as an ASCII string like so:
>>> u\'\\u003cfoo/\\u003e\'.encode(\'ascii\')
On Python 2.5 the correct encoding is "unicode_escape", not "unicode-escape" (note the underscore).
I'm not sure if the newer version of Python changed the unicode name, but here only worked with the underscore.
Anyway, this is it.