wasn't getting the charCode when escaping characters by codepoint