solve the enconding problem