replace invalid utf-8 byte sequences

This was causing some exports to crash mid-run, though I don't know the
source.