Internationalization

One of the major benefits Core Foundation brings to application development is internationalization support. Through its String Services, Core Foundation facilitates easy, robust, and consistent internationalization across all Mac OS and Cocoa programming interfaces and implementations. The essential part of this support is a type, CFString, instances of which represent an array of 16-bit Unicode characters. A CFString object is flexible enough to hold megabytes worth of characters and yet simple and low-level enough for use in all programming interfaces communicating character data. It accomplishes this with performance not much different than that associated with standard C strings.

Core Foundation String Services (which defines CFString) has dozens of associated functions that do expected things with strings such as comparing, inserting, and appending strings, and searching for substrings. String Services also provides functions that convert Unicode strings (that is, CFString objects) to and from other encodings, particularly 8-bit encodings stored as Pascal and C strings. Because most strings in programs today are 8-bit, a CFString object uses less memory for storing such strings whenever possible.

In addition, some String Services functions take arguments representing user locales. These arguments affect the operation performed or the value returned.


© 1999 Apple Computer, Inc. – (Last Updated 07 September 99)