Make test safer to run.
Only force encoding when utf8 characters will be printed.