---
title: CreateUnicodeToTextRunInfo
framework: Core Services
role: symbol
role_heading: Function
platforms: [macOS 10.0+]
path: coreservices/1433632-createunicodetotextruninfo
---

# 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

```occ
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 the iEncodings parameter 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 doc://com.apple.documentation/documentation/coreservices/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 kUnicode16BitFormat or kUnicodeUTF8Format. Note that the versions of the Unicode Converter prior to the Text Encoding Conversion Manager 1.2.1 do not support kUnicodeUTF8Format. Also, note that the unicodeEncoding field should be the same for all of the entries in iUnicodeMappings. If you pass NULL for the iUnicodeMappings parameter, 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 and ScriptOrder('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 iUnicodeMappings parameter and the state information related to the conversion.

## Return Value

Return Value A resultcode. See Result Codes.

## Discussion

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.

## See Also

### Converting From Unicode to Multiple Encodings

- [ConvertFromUnicodeToTextRun](coreservices/1433511-convertfromunicodetotextrun.md)
- [ConvertFromUnicodeToScriptCodeRun](coreservices/1433662-convertfromunicodetoscriptcoderu.md)
- [CreateUnicodeToTextRunInfoByEncoding](coreservices/1433651-createunicodetotextruninfobyenco.md)
- [CreateUnicodeToTextRunInfoByScriptCode](coreservices/1433657-createunicodetotextruninfobyscri.md)
- [DisposeUnicodeToTextRunInfo](coreservices/1433595-disposeunicodetotextruninfo.md)
- [ResetUnicodeToTextRunInfo](coreservices/1433495-resetunicodetotextruninfo.md)
