This is handed a pointer to a UTF-8 string (entity) just after the entity escape character ampersand ('&'). It parses an entity name, returning the corresponding code and storing the end of the entity (after the trailing semicolon (';')) in endp. If endp is NULL, the end result is not stored.