Improved character set processing