Improve binary file detection

We can use `String#valid_encoding?` for detecting an undefined or invalid
character.
Merge pull request #74 from kou/improve-binary-file-detection

Improve binary file detection