I've got a python script that outputs unicode to the console, and I'd like to redirect it to a file. Apparently, the redirect process in python involves converting the output to a string, so I get errors about inability to decode unicode characters. 
So then, is there any way to perform a redirect into a file encoded in UTF-8?
Set the environment variable PYTHONIOENCODING to the encoding you want before redirecting a python script to a file.  Then you won't have to modify the original script.  Make sure to write Unicode strings as well, otherwise PYTHONIOENCODING will have no effect.  If you write byte strings, the bytes are sent as-is to the terminal (or redirected file).
Can I redirect unicode output from the console directly into a file?