CFURLCreateStringByReplacingPercentEscapes(_:_:_:)
Creates a new string by replacing any percent escape sequences with their character equivalent.
Declaration
func CFURLCreateStringByReplacingPercentEscapes(_ allocator: CFAllocator!, _ originalString: CFString!, _ charactersToLeaveEscaped: CFString!) -> CFString!Parameters
- allocator:
The allocator to use to allocate memory for the new
CFStringobject. PassNULLor Kcfallocatordefault to use the current default allocator. - originalString:
The
CFStringobject to be copied and modified. - charactersToLeaveEscaped:
Characters whose percent escape sequences, such as
%20for a space character, you want to leave intact. PassNULLto specify that no percent escapes be replaced, or the empty string (CFSTR("")) to specify that all be replaced.
Return Value
A new CFString object, or NULL if the percent escapes cannot be converted to characters, assuming UTF-8 encoding. If no characters need to be replaced, this function returns the original string with its reference count incremented. Ownership follows the create rule. See The Create Rule.