Add exceptional handling for invalid charset.