Error when JSON-encoding dict with invalid UTF8

It tried to decode() a dict - that just can't work!