add test for bad encoding