Handle non-utf-8 better.

It's not perfect, but latin-1 should at least reliably yield code
points.