Contents

CreateTextToUnicodeInfoByEncoding

Based on the given text encoding specification, createsand returns a Unicode converter object containing information requiredfor converting strings from the specified non-Unicode encoding toUnicode.

Declaration

OSStatus CreateTextToUnicodeInfoByEncoding(TextEncoding iEncoding, TextToUnicodeInfo *oTextToUnicodeInfo);

Parameters

  • iEncoding:

    The text encoding specification for the source text.

  • oTextToUnicodeInfo:

    The Unicode converter object of type Texttounicodeinfo returned by the function.

Return Value

A resultcode. See Result Codes.

Discussion

You can use this function instead of the CreateTextToUnicodeInfo function whenyou do not need to create a Unicode mapping structure. You simplyspecify the text encoding of the source text. However, this methodis less efficient because the text encoding parameter must be resolvedinternally into a Unicode mapping.

You cannot specify a version of Unicode. The function usesa 16-bit form of Unicode as the default.

You pass a Unicode converter object returned from CreateTextToUnicodeInfoByEncoding to thefunction ConvertFromTextToUnicode or ConvertFromPStringToUnicode to identify the information to be used for the conversion. Thesetwo functions modify the contents of the Unicode converter object.

You pass a Unicode converter object returned from CreateTextToUnicodeInfoByEncoding to thefunction TruncateForTextToUnicode to identify the information to be used to truncate the string. Thisfunction does not modify the contents of the Unicode converter object.

If you are converting the text stream to Unicode as an intermediaryencoding, and then from Unicode to the final destination encoding,you use the function CreateUnicodeToTextInfo to create a Unicode converter object for the second part of the process.

See Also

Converting to Unicode