Fixed a crash on unicode characters.