Updated to work with unicode character set