fixing charaterset handling