Given a CFString object containing XML source with escaped entities, returns a string with specified XML entities unescaped.
- macOS 10.3+
- Core Foundation
The allocator to use to allocate memory for the new object. Pass
NULLor kCFAllocatorDefault to use the current default allocator.
Any CFString object that may contain XML source. This function translates any entity that is mapped to an substring in
entitiesto the specified substring.
Specifies the entities to be replaced. Dictionary keys should be the entity names (for example, “para” for ¶), and the values should be CFString objects containing the expansion. Pass
NULLto indicate no entities other than the standard five.
A CFString object derived from
string with entities identified in
entities unescaped to their corresponding substrings. Ownership follows the The Create Rule.
The standard five predefined entities are automatically supported.
As an example of using this function, say you apply this function to string “Refer to ¶ 5 of the contract” with a key of “para” mapped to “¶” in
entities. The resulting string is “Refer to ¶ 5 of the contract”.