Fixed displaying script output with invalid unicode characters.
Fixed displaying local console output with invalid unicode characters.