CreateUnicodeToTextRunInfoByScriptCode
Based on the given script codes for the converted textruns, creates and returns a Unicode converter object containinginformation required for converting strings from Unicode to oneor more specified non-Unicode encodings.
Declaration
OSStatus CreateUnicodeToTextRunInfoByScriptCode(ItemCount iNumberOfScriptCodes, const ScriptCode iScripts[], UnicodeToTextRunInfo *oUnicodeToTextInfo);Parameters
- iNumberOfScriptCodes:
The number of desired scripts. If you pass 0 for this parameter, the converter uses all the scripts installed in the system. In this case, 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 theiScriptsparameter contains a single element specifying the preferred script. This feature is supported beginning with the Text Encoding Conversion Manager 1.2. - iScripts:
An array of script codes for the desired scripts. Your application provides this structure to identify the scripts to be used for the conversion. The order in which you specify the scripts determines their priority. If you pass
NULLfor this parameter, the converter uses all of the scripts installed in the system. In this case, the primary script is the one with the highest priority and the priority order of the remaining scripts is defined by theScriptOrder(itlm resource)resource. This feature is supported for versions 1.2 or later of the converter. - 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 Unicode converter object that holds the scripts you supply as the
iScriptsparameter and the state information related to the conversion.
Return Value
A resultcode. See Result Codes.
Discussion
You pass a Unicode converter object returned from CreateUnicodeToTextRunInfoByScriptCode 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.