CreateUnicodeToTextRunInfo
Creates and returns a Unicode converter object containingthe information required for converting a Unicode text string tostrings in one or more non-Unicode encodings.
Declaration
OSStatus CreateUnicodeToTextRunInfo(ItemCount iNumberOfMappings, const UnicodeMapping iUnicodeMappings[], UnicodeToTextRunInfo *oUnicodeToTextInfo);Parameters
- iNumberOfMappings:
The number of mappings specified by your application for converting from Unicode to any other encoding types, including other forms of Unicode. If you pass 0 for this parameter, the converter will use all of the scripts installed in the system. The primary script is the one with highest priority;
ScriptOrder('itlm'resource)determines the priority of the rest. If you set the high-order bit for this parameter, the Unicode converter assumes that theiEncodingsparameter contains a single element specifying the preferred encoding. This feature is supported for versions 1.2 or later of the converter. - iUnicodeMappings:
A pointer to an array of structures of type Unicodemapping. Your application provides this structure to identify the mappings to be used for the conversion. The order in which you specify the mappings determines the priority of the destination encodings. For this function, the Unicode mapping structure can specify a Unicode format of
kUnicode16BitFormatorkUnicodeUTF8Format. Note that the versions of the Unicode Converter prior to the Text Encoding Conversion Manager 1.2.1 do not supportkUnicodeUTF8Format. Also, note that theunicodeEncodingfield should be the same for all of the entries iniUnicodeMappings. If you passNULLfor theiUnicodeMappingsparameter, the converter uses all of the scripts installed in the system, assuming the default version of Unicode with 16-bit format. The primary script is the one with the highest priority andScriptOrder('itlm'resource)determines the priority of the rest. This is supported beginning with version 1.2 of the Text Encoding Conversion Manager. - oUnicodeToTextInfo:
A pointer to a Unicode converter object for converting Unicode text strings to strings in one or more non-Unicode encodings. On return, a pointer to a Unicode converter object that holds the mapping table information you supply as the
iUnicodeMappingsparameter and the state information related to the conversion.
Return Value
A resultcode. See Result Codes.
Discussion
You pass a Unicode converter object returned from the function CreateUnicodeToTextRunInfo tothe function ConvertFromUnicodeToTextRun or ConvertFromUnicodeToScriptCodeRun to identify the information to be used for the conversion. Thesetwo functions modify the contents of the Unicode converter object.