Add test to check for valid encoding param to binary
Merge pull request #292 from DavidOrchard/encoding_check

Add test to check for valid encoding param to binary