Add test to check for valid encoding param to binary