Encoding support.
Set sys.stdout.encoding explicitly.
Use saved stdout.
Add test and fix some encode error.

puts() allow unicode string(encode to sys.__stdout__.encoding).
real_command now encode by env.host_encoding.