---
title: TextEncodingRun
framework: Core Services
role: symbol
role_heading: Structure
platforms: [Mac Catalyst 17.0+, macOS 10.0+]
path: coreservices/textencodingrun
---

# TextEncodingRun

Contains text encoding information for a text run.

## Declaration

```occ
typedef struct TextEncodingRun {
    ...
} TextEncodingRun;
```

## Overview

Overview It is not always possible to convert text expressed in Unicode to another single encoding because no other single encoding encompasses the Unicode character encoding range. To adjust for this, you can create a Unicode mapping structure array that specifies the target encodings the Unicode text should be converted to when multiple encodings must be used.  If the kUnicodeTextRunMask flag is set, ConvertFromUnicodeToTextRun and ConvertFromUnicodeToScriptCodeRun may convert Unicode text to a string of text containing multiple text encoding runs. Each run contains text expressed in a different encoding from that of the preceding or following text segment. For each text encoding run in the string, a TextEncodingRun structure indicates the beginning offset and the text encoding for that run.  Functions that convert text from Unicode to a text run return the converted text in an array of text encoding run structures. A text encoding run structure is defined by the TextEncodingRun data type.

## Topics

### Instance Properties

- [offset](coreservices/textencodingrun/1400422-offset.md)
- [textEncoding](coreservices/textencodingrun/1399800-textencoding.md)
