Carbon


TECConvertTextToMultipleEncodings

Header: TextEncodingConverter.h Carbon status: Supported

Converts text in the source encoding to runs of text in multiple destination encodings. It uses the conversion path specified in the converter object you supply.

OSStatus TECConvertTextToMultipleEncodings (
    TECObjectRef encodingConverter, 
    ConstTextPtr inputBuffer, 
    ByteCount inputBufferLength, 
    ByteCount *actualInputLength, 
    TextPtr outputBuffer, 
    ByteCount outputBufferLength, 
    ByteCount *actualOutputLength, 
    TextEncodingRun outEncodingsBuffer[], 
    ItemCount maxOutEncodingRuns, 
    ItemCount *actualOutEncodingRuns
);
Parameter descriptions
encodingConverter

The reference to the text encoding converter object to be used for the conversion. This is the reference returned by the function TECCreateOneToManyConverter.

inputBuffer

The stream of text to be converted.

inputBufferLength

The length in bytes of the stream of text specified in the inputBuffer parameter.

actualInputLength

On return, a pointer to a the number of source text bytes that were converted.

outputBuffer

On return, a pointer to a buffer that holds the converted text.

outputBufferLength

The length in bytes of the outputBuffer parameter.

actualOutputLength

On return, a pointer to the number of bytes of the converted text returned in the outputBuffer parameter.

outEncodingsBuffer

An array of text encoding runs for output. Note that the actual byte size of this buffer should be actualOutEncodingRuns * sizeof(TextEncodingRun).

maxOutEncodingRuns

The maximum number of runs that can fit in the outEncodingsBuffer array.

actualOutEncodingRuns

On return, a pointer to the number of runs in outEncodingsBuffer array.

function result

A result code. If there is not enough memory available to convert the text when allocating internal buffers, the function returns the appropriate Memory Manager result code.

DISCUSSION

For the function to return successfully, the output buffer you allocate must be large enough to accommodate the converted text. If the output buffer is too small to accommodate any converted text, the function will fail. For best results, you should follow these guidelines when you allocate an output buffer:

The Text Encoding Converter creates internal buffers that hold intermediate results for indirect conversions

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)