CFStringCreateFromExternalRepresentationHeader: CFString.h

Creates a CFString object from its "external representation."

CFStringRef CFStringCreateFromExternalRepresentation (
    CFAllocatorRef alloc, 
    CFDataRef data, 
    CFStringEncoding encoding
);
alloc

Pass a reference to an allocator object or pass NULL to request the default allocator.

data

Pass a reference to CFData object containing bytes that hold the characters in the specified encoding.

encoding

Encoding to use when interpreting the bytes in the data argument.

function result

A reference to an immutable CFString object or NULL if there was a problem creating the object.

DISCUSSION

The CFStringCreateFromExternalRepresentation function creates a CFString object from its "external representation." In this form (that is, as a CFData object), the character data can be written to disk as a file or be sent out over a network. If the encoding of the characters in the data object is Unicode, the function reads any BOM (byte order marker) and properly resolves endianness.

The CFStringCreateExternalRepresentation function complements this function by creating an "external representation" CFData object from a CFString object.


© 1999 Apple Computer, Inc. — (Last Updated 9/15/99)