Added different handling of UTF-8 exceptions.