A CFCharacterSet object represents a set of Unicode compliant characters. CFString uses CFCharacterSet objects to group characters together for searching operations, so that they can find any of a particular set of characters during a search. The two opaque types, CFCharacterSet and CFMutableCharacterSet, define the interface for static and dynamic character sets, respectively. The objects you create using these opaque types are referred to as character set objects (and when no confusion will result, merely as character sets).

CFCharacterSet's principal function, CFCharacterSetIsCharacterMember, provides the basis for all other functions in its interface. You create a character set using one of the CFCharacterSetCreate... functions. You may also use any one of the predefined character sets using the CFCharacterSetGetPredefined function.

CFCharacterSet is “toll-free bridged” with its Cocoa Foundation counterpart, NSCharacterSet. This means that the Core Foundation type is interchangeable in function or method calls with the bridged Foundation object. Therefore, in a method where you see an NSCharacterSet * parameter, you can pass in a CFCharacterSetRef, and in a function where you see a CFCharacterSetRef parameter, you can pass in an NSCharacterSet instance. This capability also applies to concrete subclasses of NSCharacterSet. See Toll-Free Bridged Types for more information on toll-free bridging.


Creating Character Sets


Creates a new character set with the values from a given character set.


Creates a new immutable character set that is the invert of the specified character set.


Creates a new character set with the values from the given range of Unicode characters.


Creates a new character set with the values in the given string.


Creates a new immutable character set with the bitmap representation specified by given data.

Getting Predefined Character Sets


Returns a predefined character set.

Querying Character Sets


Creates a new immutable data with the bitmap representation from the given character set.


Reports whether or not a character set contains at least one member character in the specified plane.


Reports whether or not a given Unicode character is in a character set.


Reports whether or not a given UTF-32 character is in a character set.


Reports whether or not a character set is a superset of another set.

Getting the Character Set Type Identifier


Returns the type identifier of the CFCharacterSet opaque type.

Data Types


Defines a predefined character set.


A reference to an immutable character set object.


Predefined CFCharacterSet Selector Values

Identifiers for the available predefined CFCharacterSet objects.

See Also

Opaque Types


The CFFileDescriptor provides an opaque type to monitor file descriptors for read and write activity via CFRunLoop.


CFStringTokenizer allows you to tokenize strings into words, sentences or paragraphs in a language-neutral way. It supports languages such as Japanese and Chinese that do not delimit words by spaces, as well as de-compounding German compounds. You can obtain Latin transcription for tokens. It also provides language identification API.