Add invalid_encoding error for invalid byte sequences