fixed bug in logic for charset name handling