Encode to utf-8 when writing error output.