parse charset strings