Also use the encoding switch when reading from STDIN
Merge pull request #1 from roderik/patch-1

Also use the encoding switch when reading from STDIN