better character set handling