handle invalid utf better and warn, refs #664