> ## 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 character set of string

> Converts a string from one encoding to another.

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 from one encoding to another. A character set (or encoding) is the way text is stored as bytes, and text written in one encoding can show up as garbled characters when read with another. You tell this step which encoding the value is currently in and which one you want it in. A handy trick is converting to `ASCII//TRANSLIT`, which replaces accented and special characters with their closest plain-ASCII equivalent instead of dropping them.

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

## Fields

<FormField property="inCharset" label="In charset" required>
  The character set the incoming text is currently in, for example `UTF-8`, `ISO-8859-1` or `Windows-1252`. Set this to match the system the text came from, otherwise the conversion comes out wrong.
</FormField>

<FormField property="outCharset" label="Out charset" required>
  The character set you want the text converted to, for example `UTF-8`. Add `//TRANSLIT` (as in `ASCII//TRANSLIT`) to replace characters that do not exist in the target set with a close equivalent rather than losing them.
</FormField>

## Sample data

| Field       | Value             |
| ----------- | ----------------- |
| In charset  | `UTF-8`           |
| Out charset | `ASCII//TRANSLIT` |

Input:

```json theme={null}
{ "name": "Crème brûlée" }
```

Output:

```json theme={null}
{ "name": "Creme brulee" }
```

```json Configuration theme={null}
{
  "prototype": "string-iconv",
  "parameters": {
    "inCharset": "UTF-8",
    "outCharset": "ASCII//TRANSLIT"
  }
}
```
