Throw an error when encountering invalid characters.
Merge pull request #10 from Kusold/validate-char

Throw an error when encountering invalid characters.