Pass character codes around in TextUtils

Previously the character codes were looked up for each type of character pair.