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



Converting to Unicode

For each stream of text in a single encoding that you want to convert to Unicode, your application must first call the function CreateTextToUnicodeInfo or CreateTextToUnicodeInfoByEncoding to create a Unicode converter object. When you call these functions, they locate and load the mapping tables required for the conversion, based on the mapping table information you provide.

After you finish converting a text stream using a Unicode converter object, you should dispose of the memory allocated for the Unicode converter object by calling function DisposeTextToUnicodeInfo.

You can use the same Unicode converter object to convert multiple text segments of a single text stream. A Unicode converter object persists until you dispose of it. You should use the same Unicode converter object only to convert segments of text belonging to the text stream for which you created the object.You should create a new Unicode converter object to convert another stream of text even if you intend to use the same mapping information stored in an existing Unicode converter object. This is because the Unicode Converter stores private state information in a Unicode converter object that is relevant only to the single text stream for which it is used.

For example, to convert a document in a single encoding to Unicode, your application can use a single Unicode converter object. Each time you call the ConvertFromTextToUnicode function to convert a segment of text belonging to the text stream, you pass the function the same object, repeating the process until the entire text stream is converted.

CreateTextToUnicodeInfo

CreateTextToUnicodeInfoByEncoding

ChangeTextToUnicodeInfo

ConvertFromTextToUnicode

DisposeTextToUnicodeInfo


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

Up Previous Next