> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alumio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# String: Convert encoding

> Converts a string to the specified encoding. The from encoding must be known.

export const FormField = ({property, label, required = false, diType, uiPatterns, children}) => {
  const patterns = Array.isArray(uiPatterns) ? uiPatterns : uiPatterns ? [uiPatterns] : [];
  return <div style={{
    margin: '1.5rem 0'
  }}>
      <div style={{
    display: 'flex',
    alignItems: 'baseline',
    flexWrap: 'wrap',
    gap: '0.5rem',
    marginBottom: '0.25rem'
  }}>
        <strong>{label}</strong>
        <span style={{
    fontSize: '0.7rem',
    fontWeight: 600,
    textTransform: 'uppercase',
    letterSpacing: '0.04em',
    color: required ? '#6241f5' : '#6b7280'
  }}>
          {required ? 'Required' : 'Optional'}
        </span>
      </div>

      <div>{children}</div>

      {diType || patterns.length > 0 ? <p style={{
    fontSize: '0.85rem',
    color: '#6b7280',
    marginBottom: 0
  }}>
          {diType ? <>
              See the <a href={`/references/${diType}`}>{diType}</a> reference.{' '}
            </> : null}
          {patterns.length > 0 ? <>
              Accepts a <a href={`/documentation/placeholders-and-patterns/patterns#${patterns[0]}`}>pattern</a>.
            </> : null}
        </p> : null}
    </div>;
};

Converts a string to the specified encoding. The from encoding must be known. A character encoding is the way text is stored as bytes; different systems sometimes use different encodings, which is what makes accented or special characters appear garbled when text moves between them. This step re-encodes the value: you tell it which encoding the value is currently in and which encoding you want it stored as, so it lands correctly in the target system.

This documentation describes: [Schema](/schemas/mapper/string-convert-encoding)

## Fields

<FormField property="fromEncoding" label="From encoding">
  The encoding the incoming value is currently in, such as `ISO-8859-1` or `Windows-1252`. This must match the value's actual current encoding for the conversion to come out right. Leave it empty to let the step detect the current encoding itself.
</FormField>

<FormField property="toEncoding" label="To encoding">
  The encoding you want the value converted to, such as `UTF-8`. Enter the name of the target encoding exactly.
</FormField>

## Sample data

This step changes how text is stored as bytes rather than how it reads, so a before/after that prints the same characters on both sides does not show anything useful, and converting to a non-UTF-8 target produces bytes that cannot be displayed as plain text here. The example below is therefore shown as a configuration rather than a before/after.

A common use is taking a value a source system delivers in the older Western European encoding (`ISO-8859-1`) and re-encoding it as `UTF-8` so accented characters such as ö or é display correctly downstream instead of appearing as garbled symbols.

| Field         | Value        |
| ------------- | ------------ |
| From encoding | `ISO-8859-1` |
| To encoding   | `UTF-8`      |

```json Configuration theme={null}
{
  "prototype": "string-convert-encoding",
  "parameters": {
    "fromEncoding": "ISO-8859-1",
    "toEncoding": "UTF-8"
  }
}
```
