close to done, working on a invalid byte sequence in UTF-8 issue