Improve the performance
Handle extended codepoints