properly handle byte length of unicode string terms