Fix output when input contains non-ascii character