fix invalid multibyte chars