How to write output in UTF-8? I've a binary file with special characters, and the output doesn't encode them correctly!