Invalid utf8 sequence in some cases