### Extracting char* Data from an IText Object

IText provides simple conversion operators that can convert character data in an IText object into a null-terminated `char` array or an IString object. The text is transcoded from Unicode data into `char` data. The framework assumes that you want the `char` data to be encoded in the default encoding system for the current host.

To extract `char` data from an IText object, simply assign it to a variable of the type you want (`char*` or IString):

    IText unicodeString("Hello World!");

    const char* charData;

    charData = unicodeString;

When you extract `char` data from an IText object, keep in mind that the IText conversion functions return a pointer to an internal storage object. The IText object maintains ownership of this storage, which is why the functions return a `const` `char` array. The return value is only guaranteed to be good until the underlying data in the IText is modified. You should not allocate storage to receive the character data, nor should you cast away the `const` and modify the characters.

If you need a modifiable copy of the character data, allocate your own storage and copy the characters:

    IText unicodeString("Hello World!");

    char* modifiableCharData = new char[unicodeString.length()];

    strcpy(modifiableCharData, unicodeString);

    // Can modify the char data without affecting the underyling
    IText storage

    modifiableCharData[0] = `J';

    const char* moreCharData;

    // The underlying IText still contains "Hello World!"

    moreCharData = unicodeString;