Fix encoding for UTF-8 output