refactor UTF-16 checker