Util.pm: Modified guess_terminal_encoding some handlings.
util.t: Add guess_terminal_encoding tests.