Remove bad encoded character at the end of the line