---
title: CreateUnicodeToTextInfoByEncoding
framework: Core Services
role: symbol
role_heading: Function
platforms: [macOS 10.0+]
path: coreservices/1433550-createunicodetotextinfobyencodin
---

# CreateUnicodeToTextInfoByEncoding

Based on the given text encoding specification for theconverted text, creates and returns a Unicode converter object containinginformation required for converting strings from Unicode to thespecified non-Unicode encoding.

## Declaration

```occ
OSStatus CreateUnicodeToTextInfoByEncoding(TextEncoding iEncoding, UnicodeToTextInfo *oUnicodeToTextInfo);
```

## Parameters

- `iEncoding`: The text encoding specification for the destination, or converted, text.
- `oUnicodeToTextInfo`: A pointer to a Unicode converter object of type doc://com.apple.documentation/documentation/coreservices/unicodetotextinfo.

## Return Value

Return Value A resultcode. See Result Codes.

## Discussion

Discussion You can use this function instead of the  CreateUnicodeToTextInfo  function tocreate a Unicode converter. However, this method is less efficientinternally because the destination text encoding you specify mustbe resolved into a Unicode mapping. Using this function, you cannotspecify a version of Unicode, so a default version of Unicode is used;16-bit format is assumed. You pass a Unicode converter object returned from the function CreateUnicodeToTextInfoByEncoding tothe function  ConvertFromUnicodeToText or  ConvertFromUnicodeToPString 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 CreateUnicodeToTextInfoByEncoding to thefunction  TruncateForUnicodeToText to identify the information to be used to truncate the string. Thisfunction does not modify the contents of the Unicode converter object.

## See Also

### Converting From Unicode

- [ChangeUnicodeToTextInfo](coreservices/1433509-changeunicodetotextinfo.md)
- [ConvertFromUnicodeToText](coreservices/1433542-convertfromunicodetotext.md)
- [CreateUnicodeToTextInfo](coreservices/1433522-createunicodetotextinfo.md)
- [DisposeUnicodeToTextInfo](coreservices/1433564-disposeunicodetotextinfo.md)
- [ResetUnicodeToTextInfo](coreservices/1433647-resetunicodetotextinfo.md)
