Creates a string from a buffer containing characters in a specified encoding.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Core Foundation
The allocator to use to allocate memory for the new string. Pass
kto use the current default allocator.
A buffer containing characters in the encoding specified by
encoding. The buffer must not contain a length byte (as in Pascal buffers) or any terminating
NULLcharacter (as in C buffers).
The number of bytes in
The string encoding of the characters in the buffer.
trueif the characters in the byte buffer are in an “external representation” format—that is, whether the buffer contains a BOM (byte order marker). This is usually the case for bytes that are read in from a text file or received over the network. Otherwise, pass
An immutable string, or
NULL if there was a problem creating the object. Ownership follows the The Create Rule.
This function handles character data in an “external representation” format by interpreting any BOM (byte order marker) character and performing any necessary byte swapping.