Respect --charset for stdin
Merge pull request #653 from pauldraper/pauldraper-input-encoding

--charset doesn't work for stdin