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.
You'd use that pattern if you're specifically checking for `None`. In this scenario, we just care if there is a value.
So, IMO it's more pythonic to leverage the truthiness:
http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#testing-for-truth-values