check encoding