server: catch invalid utf8 exceptions

issue reported by coverity