Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Up Previous Next 

PATH 
Mac OS 8 and 9 Developer Documentation > Text Encoding Conversion Manager
Programming With the Text Encoding Conversion Manager



TextEncodingRun

It is not always possible to convert text expressed in Unicode to another single encoding because no other single encoding encompasses the Unicode character encoding range. To adjust for this, you can create a Unicode mapping structure array that specifies the target encodings the Unicode text should be converted to when multiple encodings must be used.

If the kUnicodeTextRunMask flag is set, ConvertFromUnicodeToTextRun and ConvertFromUnicodeToScriptCodeRun may convert Unicode text to a string of text containing multiple text encoding runs. Each run contains text expressed in a different encoding from that of the preceding or following text segment. For each text encoding run in the string, a TextEncodingRun structure indicates the beginning offset and the text encoding for that run.

Functions that convert text from Unicode to a text run return the converted text in an array of text encoding run structures. A text encoding run structure is defined by the TextEncodingRun data type.

struct TextEncodingRun {
    ByteOffset          offset;     
    TextEncoding        textEncoding;   
};
typedef struct TextEncodingRun TextEncodingRun;
offset
The beginning character position of a run of text in the converted text string.

textEncoding
The encoding of the text run that begins at the position specified.

struct TextEncodingRun {
    ByteOffset offset;
    TextEncoding textEncoding;
};
offset
The byte offset at which the given text encoding begins. The offset is from the beginning of the text buffer.

textEncoding
The text encoding that begins at the byte offset.


© 1999 Apple Computer, Inc. – (Last Updated 13 Dec 99)

Up Previous Next