# Encode text

## Description

This operation encodes UTF-8 text into a specified character encoding format. It supports a wide range of character encodings including Unicode, Windows code pages, IBM/DOS code pages, EBCDIC, ISO-8859 series, and various Asian language encodings.

Use this operation when you need to convert UTF-8 text to legacy or platform-specific encodings for compatibility with systems that require specific character sets.

***

## Data types

These are the input/output expected data types for this operation:

### Input data

![](/files/PLlLS9WDthpZu0nbKCNG) - Decoded text you want to encode.

### Output data

![](/files/FiO6hMIDNPuoHDSTAxHC) - Encoded text.

<details>

<summary>Supported encodings</summary>

#### Unicode

* UTF-8 (65001)
* UTF-16LE (1200)
* UTF-16BE (1201)

#### Windows Code Pages

* Windows-874 Thai (874)
* Windows-1250 Central European (1250)
* Windows-1251 Cyrillic (1251)
* Windows-1252 Latin (1252)
* Windows-1253 Greek (1253)
* Windows-1254 Turkish (1254)
* Windows-1255 Hebrew (1255)
* Windows-1256 Arabic (1256)
* Windows-1257 Baltic (1257)
* Windows-1258 Vietnam (1258)

#### IBM/OEM DOS Code Pages

* OEM United States (437)
* OEM Multilingual Latin 1; Western European (DOS) (850)
* OEM Latin 2; Central European (DOS) (852)
* OEM Cyrillic (primarily Russian) (855)
* OEM Multilingual Latin 1 + Euro symbol (858)
* OEM Portuguese; Portuguese (DOS) (860)
* OEM Hebrew; Hebrew (DOS) (862)
* OEM French Canadian; French Canadian (DOS) (863)
* OEM Nordic; Nordic (DOS) (865)
* OEM Russian; Cyrillic (DOS) (866)

#### EBCDIC

* IBM EBCDIC US-Canada (37)
* IBM EBCDIC Latin 1/Open System (1047)

#### ISO-8859 Series

* ISO-8859-1 through ISO-8859-16 (Latin and regional variants)

#### Asian Language Encodings

* Japanese: Shift-JIS (932), EUC Japanese (51932), ISO 2022 JIS variants
* Chinese: GBK (936), GB18030 (54936), HZ-GB2312 (52936), Big5 (950)
* Korean: Korean (949), EUC Korean (51949)

#### Cyrillic

* KOI8-R Russian Cyrillic (20866)
* KOI8-U Ukrainian Cyrillic (21866)

#### Macintosh

* MAC Roman (10000)
* Cyrillic (Mac) (10007)

</details>

***

## Parameters

These are the parameters you need to configure to use this operation (mandatory parameters are marked with a <mark style="color:red;">**\***</mark>):

<details>

<summary>Target Encoding<mark style="color:red;"><strong>*</strong></mark></summary>

Choose the encoding format of your output text. The default value is `UTF-8 (65001)`

</details>

***

## Example

Encoding UTF-8 text to Windows-1252 (Latin):

```
Input: "café" (UTF-8)
Encoding: Windows-1252 Latin (1252)
Output: "caf\xe9" (Windows-1252 encoded)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onum.com/the-workspace/pipelines/actions/transformation/field-transformation/field-transformation-operations/data-encoding/encode-text.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
