UnicodeDecodeError if stdin encoding is not utf-8

UnicodeDecodeError is raised if standard input encoding is not utf-8 (ie. on Windows).
This PR is using `sys.stdin.encoding` to decode input.
That OK to. I'm just used to `if x is not None`