Fix invalid UTF-8 issue