---
title: "Character Encoding in Nodinite: Context Property, XML Declaration, Endpoint, and Message Type"
description: "How Nodinite decides the character encoding of a logged message: the per-event context property, then the XML declaration, then the Endpoint, then the Message Type (default UTF-8 without BOM). Lists every supported encoding and the values the Log API accepts."
---

# <i class="fal fa-language" aria-hidden="true"></i> Character Encoding

A logged message body is stored as bytes. To search it, show it, transform it with a [Stylesheet][Stylesheets], or let you download it as text, <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> must know which **character encoding** turns those bytes into characters. If the encoding is wrong, `Ä`, `é`, and `ø` turn into garbage, [Search Field Expressions][] miss values, and XML parsers fail on an unexpected byte order mark (BOM). <sup><span class="nodinite-new-badge">New 7.11</span></sup>

From <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> 7.11, you set the encoding where it belongs, and <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> uses it consistently everywhere the message is read:

* <i class="fal fa-file" aria-hidden="true"></i> **Per [Message Type][Message Types]** – the default for every message of that format (**UTF-8 (without BOM)** unless you change it)  
* <i class="fal fa-sign-in-alt" aria-hidden="true"></i> **Per [Endpoint][Endpoints]** – override the Message Type when the same format arrives in a different encoding on a specific Endpoint  
* <i class="fal fa-code" aria-hidden="true"></i> **Per XML body** – an `encoding` named in the XML declaration of the body is honored automatically  
* <i class="fal fa-tag" aria-hidden="true"></i> **Per [Log Event][]** – override everything for a single message with the [`ExtendedProperties/1.0#Encoding`][Context Options - Encoding] context property  
* <i class="fal fa-file-zipper" aria-hidden="true"></i> **Base64 Decode into any encoding** – decode Base64-wrapped payloads into the encoding the original content used  
* <i class="fal fa-download" aria-hidden="true"></i> **Download converted to** – download a message converted to the encoding a receiving system needs  

![Search the Log View Contoso: Customer address exports, open the AS/400 export with Action, View message body, read it right as ISO-8859-1, pick UTF-8 so å, ä and ö turn into replacement characters, open the Message Type's Character encoding ISO-8859-1, and view the body again read right, animated walkthrough (7.12)][Hero]  
*Animated walkthrough: an AS/400 customer address export written in ISO-8859-1. **View message body** reads it right, because its [Message Type][Message Types] says ISO-8859-1. Read as UTF-8, the same bytes turn `å`, `ä`, and `ö` into replacement characters, which is what a wrong encoding looks like.*  

## <i class="fal fa-diagram-project" aria-hidden="true"></i> Understanding encoding resolution

<span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> picks one encoding for each message by checking four levels, highest priority first. The first level that holds a value wins.

<div class="mermaid">
flowchart TD
    A["fa:fa-envelope Log Event body (bytes)"] --> B{"1. Context property<br/>ExtendedProperties/1.0#Encoding<br/>set on the Log Event?"}
    B -- Yes --> R["fa:fa-check Resolved encoding"]
    B -- No --> X{"2. XML declaration<br/>in the body names<br/>an encoding?"}
    X -- Yes --> R
    X -- No --> C{"3. Endpoint<br/>Character encoding set?<br/>(not Inherit from the Message Type)"}
    C -- Yes --> R
    C -- No --> D["4. Message Type<br/>Character encoding<br/>(default: UTF-8 without BOM)"]
    D --> R
    R --> U1["fa:fa-gears Logging Service<br/>processing and re-indexing"]
    R --> U2["fa:fa-eye View Message<br/>and Stylesheets"]
    R --> U3["fa:fa-wand-magic-sparkles Search Field Wizard"]
    R --> U4["fa:fa-download Download converted to"]
    style A fill:#2678BD
    style B fill:#9E59BB
    style X fill:#D5396D
    style C fill:#E47528
    style D fill:#3F827B
    style R fill:#93d16d
</div>

*Encoding resolution: the per-event context property (purple, priority 1) beats the XML declaration (pink, priority 2), which beats the Endpoint (orange, priority 3), which beats the Message Type (teal, priority 4). The resolved encoding (green) is used everywhere <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> reads the message as text.*

### <i class="fal fa-puzzle-piece" aria-hidden="true"></i> The four levels explained

| Priority | Level | Where it comes from | Default | Use it when |
| :---: | --- | --- | --- | --- |
| 1 | Context property `ExtendedProperties/1.0#Encoding` | The [Log Event][] context, from your logging code or [Log Agent][Log Agents] | Not set | One message differs from the rest, or the sender knows the encoding at runtime |
| 2 | XML declaration | The body itself, for example `<?xml version="1.0" encoding="windows-1252"?>` | Not set | Automatic for XML bodies that declare their encoding; nothing to configure |
| 3 | [Endpoint][Endpoints] | **Character encoding** on the [Endpoint edit page][Add or manage Endpoint], or the [Web API][] | **Inherit from the Message Type** | One Endpoint receives a format in another encoding than usual, such as a legacy FTP drop in Windows-1252 |
| 4 | [Message Type][Message Types] | **Character encoding** on the [Message Type edit page][Add or manage Message Type], or the [Web API][] | **UTF-8 (without BOM)** | A message format always uses the same encoding |

<aside aria-label="Tip" class="nodinite-note nodinite-note--tip">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-lightbulb"></i> Tip</p>
<div class="nodinite-note__content"><p>Set the encoding on the Message Type first. Add an Endpoint override only where a format arrives differently, and keep the context property for the exceptions your code knows about at runtime.</p></div>
</aside>

![Character encoding list open on the Message Type edit page, from UTF-8 (without BOM) to Base64 Decode into UTF-8 (with BOM), each with its Id (7.12)][1]  
*The same list of encodings is offered on Message Types and Endpoints; the Id next to each option is the numeric value the Log API accepts.*  

## <i class="fal fa-gears" aria-hidden="true"></i> Where Nodinite uses the resolved encoding

| Feature | What happens | Configured by |
| --- | --- | --- |
| [Logging Service][] processing and re-indexing | Decodes the body before evaluating [Search Field Expressions][], so extracted values have the right characters | Resolved encoding |
| **View Message** ([Log Views][]) | The encoding dropdown opens on the resolved encoding; its tooltip says where it came from, such as *From the Message Type* | Resolved encoding (you can still pick another) |
| **View details** ([Log Views][]) | Shows the **Encoding** under [Message Type][Message Types] | Resolved encoding |
| **View message formatted as…** ([Stylesheets][]) | Converts the body from the resolved encoding to UTF-8 before inserting it into the Stylesheet | Resolved encoding |
| [Search Field Wizard][] | The **Encoding** dropdown on the **Test** step opens on the resolved encoding | Resolved encoding (you can still pick another) |
| **Download converted to** | Reads the body with the resolved encoding and saves it in the target encoding you choose | You choose the target |
| **Download** | Saves the original bytes, unchanged | Not affected |
| **Repair message** | Writes the message in its original encoding, unless you choose the encoding configured in the editor | Separate setting, see [Download, repair, and resubmit](#fa-download-download-repair-and-resubmit) |

<h2 id="fa-list-supported-encodings"><i class="fal fa-list" aria-hidden="true"></i> Supported encodings</h2>

The table lists each encoding, its numeric value, and every input the [Log API][] accepts for it in the `ExtendedProperties/1.0#Encoding` context property. The dropdowns in the [Web Client][] show the display names, such as **UTF-8 (without BOM)** and **Base64 Decode into UTF-8 (without BOM)**.

| Encoding (value) | Accepted inputs |
| --- | --- |
| <span id="encoding-1"></span>**UTF8** (1) | `1`, `UTF8` / `utf-8`, `UTF-8 (without BOM)` |
| <span id="encoding-2"></span>**UTF8WithBom** (2) | `2`, `UTF8WithBom` / `UTF-8 (with BOM)` / `utf-8 with bom`, `utf-8-bom` |
| <span id="encoding-3"></span>**UTF16** (3) | `3`, `UTF16` / `utf-16`, `UTF-16 (without BOM)`, `utf-16le`, `unicode` |
| <span id="encoding-4"></span>**UTF16WithBom** (4) | `4`, `UTF16WithBom` / `UTF-16 (with BOM)`, `utf-16-bom` |
| <span id="encoding-5"></span>**ASCII** (5) | `5`, `ASCII`, `us-ascii` |
| <span id="encoding-6"></span>**Windows1252** (6) | `6`, `Windows1252` / `Windows-1252`, `cp1252` |
| <span id="encoding-7"></span>**ISO8859_1** (7) | `7`, `ISO8859_1` / `ISO-8859-1`, `latin1` / `latin-1` |
| <span id="encoding-8"></span>**EBCDIC** (8) | `8`, `EBCDIC`, `EBCDIC (IBM037)`, `ibm037`, `cp037` |
| <span id="encoding-11"></span>**Base64UTF8** (11) | `11`, `Base64UTF8` / `base64:utf-8`, `Base64 Decode into UTF-8 (without BOM)`, `base64:UTF-8 (without BOM)` |
| <span id="encoding-12"></span>**Base64UTF8WithBom** (12) | `12`, `Base64UTF8WithBom` / `base64:UTF-8 (with BOM)`, `Base64 Decode into UTF-8 (with BOM)`, `base64:utf-8-bom` |
| <span id="encoding-13"></span>**Base64UTF16** (13) | `13`, `Base64UTF16` / `base64:utf-16`, `Base64 Decode into UTF-16 (without BOM)`, `base64:UTF-16 (without BOM)`, `base64:utf-16le`, `base64:unicode` |
| <span id="encoding-14"></span>**Base64UTF16WithBom** (14) | `14`, `Base64UTF16WithBom` / `base64:UTF-16 (with BOM)`, `Base64 Decode into UTF-16 (with BOM)`, `base64:utf-16-bom` |
| <span id="encoding-15"></span>**Base64ASCII** (15) | `15`, `Base64ASCII` / `base64:ascii`, `Base64 Decode into ASCII`, `base64:us-ascii` |
| <span id="encoding-16"></span>**Base64Windows1252** (16) | `16`, `Base64Windows1252` / `base64:windows-1252`, `Base64 Decode into Windows-1252`, `base64:cp1252` |
| <span id="encoding-17"></span>**Base64ISO8859_1** (17) | `17`, `Base64ISO8859_1` / `base64:iso-8859-1`, `Base64 Decode into ISO-8859-1`, `base64:latin1` |
| <span id="encoding-18"></span>**Base64EBCDIC** (18) | `18`, `Base64EBCDIC` / `base64:ebcdic`, `Base64 Decode into EBCDIC (IBM037)`, `base64:EBCDIC (IBM037)`, `base64:ibm037`, `base64:cp037` |

<aside aria-label="Important" class="nodinite-note nodinite-note--important">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-message-exclamation"></i> Important</p>
<div class="nodinite-note__content"><p>A value that matches none of the accepted inputs falls back to <strong>UTF-8</strong>. Check the spelling when special characters look wrong for messages that carry the context property.</p></div>
</aside>

### <i class="fal fa-code-compare" aria-hidden="true"></i> With BOM vs without BOM

A byte order mark (BOM) is an invisible marker at the start of a UTF-8 or UTF-16 file. Some systems require it, others choke on it.

| Option | Reads the BOM | Keeps the BOM in the text |
| --- | --- | --- |
| **UTF-8 (without BOM)** / **UTF-16 (without BOM)** | ✅ Yes | ❌ No – the BOM is removed |
| **UTF-8 (with BOM)** / **UTF-16 (with BOM)** | ✅ Yes | ✅ Yes – the BOM stays, so you can see it and send it on |

In **View Message**, select a *with BOM* encoding and turn on **Show hidden characters** to see whether a message starts with a BOM. To strip a BOM before a Search Field Expression extracts values, use the [removebom][] formula function.

![View Message with UTF-8 (with BOM) selected and Show hidden characters on: a red BOM marker before the first character of a web shop customer note (7.12)][2]  
*With **UTF-8 (with BOM)** selected and **Show hidden characters** on, the BOM appears as a red `BOM` marker before the first character.*  

### <i class="fal fa-file-zipper" aria-hidden="true"></i> Base64 Decode into an encoding

Some platforms log the body as Base64 text, for example when the original content is binary or wrapped in JSON. A **Base64 Decode into …** encoding first decodes the Base64 text to bytes, and then reads those bytes with the encoding named after *into*. To decode a Base64 value inside a message for a [Search Field][Search Fields], use the [base64decode][] formula function.

<aside aria-label="Note" class="nodinite-note nodinite-note--note">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-note"></i> Note</p>
<div class="nodinite-note__content"><p>In earlier versions, the single <strong>Base64 Decode</strong> option always decoded into UTF-8. From 7.11 it is named <strong>Base64 Decode into UTF-8 (without BOM)</strong>, and there is one <strong>Base64 Decode into …</strong> option for every other supported encoding, including <strong>UTF-8 (with BOM)</strong>.</p></div>
</aside>

## <i class="fal fa-tag" aria-hidden="true"></i> Set the encoding for a single Log Event

Add the `ExtendedProperties/1.0#Encoding` key to the context of the [Log Event][] with any accepted input from the [Supported encodings](#fa-list-supported-encodings) table. This value overrides the XML declaration, the Endpoint, and the Message Type.

```json
{
  "Context": {
    "ExtendedProperties/1.0#Encoding": "Windows-1252"
  }
}
```

The numeric value works too, which is convenient from code that already uses the enumeration:

```json
{
  "Context": {
    "ExtendedProperties/1.0#Encoding": "6"
  }
}
```

See [Context Options][] for the other keys you can set on a [Log Event][].

## <i class="fal fa-download" aria-hidden="true"></i> Download, repair, and resubmit

These actions look alike but treat encoding differently. **Repair message** is deliberately kept apart from the encoding settings on this page, so a repaired message reaches the receiving system in the same encoding it originally arrived in.

| Action | Where | Encoding of the result |
| --- | --- | --- |
| **Download** | **View Message**, **View details**, Actions menu | Original bytes, unchanged |
| **Download converted to** | The download-converted button in **View Message**, the **Download** menu on **View details**, and the [Web API][] | The target you choose: UTF-8 or UTF-16 with or without BOM, ASCII, Windows-1252, ISO-8859-1, or EBCDIC (IBM037) |
| **Repair message** | **View details** > **Repair** | **Use original encoding** by default; select **Use the encoding configured in the editor** to write it in the encoding chosen in the editor's dropdown instead |

Read more in [What is a Log View?][Log Views].

## <i class="fal fa-robot" aria-hidden="true"></i> Automate with the Web API

The [Web API][] exposes the character encoding on both the Message Type and the Endpoint models, so you can set it from DevOps pipelines together with the rest of your [Repository Model][]. The Web API download operation accepts a target encoding as a parameter, which works like **Download converted to** in the [Web Client][].

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

* <i class="fal fa-file" aria-hidden="true"></i> [Add or manage Message Type][] – Set the default encoding for a format  
* <i class="fal fa-sign-in-alt" aria-hidden="true"></i> [Add or manage Endpoint][] – Override the encoding for one Endpoint  
* <i class="fal fa-tags" aria-hidden="true"></i> [Context Options][] – Set the encoding for a single Log Event  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

* <i class="fal fa-bolt" aria-hidden="true"></i> [Log Event][]  
* <i class="fal fa-hard-drive" aria-hidden="true"></i> [Log Views][]  
* <i class="fal fa-wand-magic-sparkles" aria-hidden="true"></i> [Search Field Wizard][]  
* <i class="fal fa-palette" aria-hidden="true"></i> [Stylesheets][]  
* <i class="fal fa-cogs" aria-hidden="true"></i> [Logging Service][]  
* <i class="fal fa-plug" aria-hidden="true"></i> [Endpoint Types][]  

[1]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Repository/MessageTypes/EncodingOptions.png
[2]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/WebClient/Log/ViewMessageBody_ShowBOMExample.png

[Add or manage Endpoint]:https://docs.nodinite.com/getting-started/repository/endpoints/add-or-manage-endpoint/
[Add or manage Message Type]:https://docs.nodinite.com/getting-started/repository/message-types/add-or-manage-message-type/
[base64decode]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/convert/base64decode/
[Context Options]:https://docs.nodinite.com/core-services/log-event/features/context-options/
[Context Options - Encoding]:https://docs.nodinite.com/core-services/log-event/features/context-options/#encoding
[Endpoint Types]:https://docs.nodinite.com/core-services/log-event/features/endpoint-types/
[Endpoints]:https://docs.nodinite.com/repository-model/endpoints/overview/
[Hero]:https://docs.nodinite.com/media/Documentation%20Pictures/IM/CoreServices/LogAPI/CharacterEncoding_Body.gif
[Log Agents]:https://docs.nodinite.com/administration/log-management/log-agents/features/what-is-a-log-agent/
[Log API]:https://docs.nodinite.com/core-services/log-api/overview/
[Log Event]:https://docs.nodinite.com/core-services/log-event/overview/
[Log Views]:https://docs.nodinite.com/administration/log-management/log-views/features/what-is-a-log-view/
[Logging Service]:https://docs.nodinite.com/core-services/logging-service/overview/
[Message Types]:https://docs.nodinite.com/repository-model/message-types/overview/
[removebom]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/alter/removebom/
[Repository Model]:https://docs.nodinite.com/repository-model/overview/
[Search Field Expressions]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/overview/
[Search Field Wizard]:https://docs.nodinite.com/administration/log-management/search-fields/getting-started/how-to-use-the-search-field-wizard/
[Search Fields]:https://docs.nodinite.com/administration/log-management/search-fields/features/what-is-a-search-field/
[Stylesheets]:https://docs.nodinite.com/administration/customize/stylesheets/features/what-is-a-stylesheet/
[Web API]:https://docs.nodinite.com/core-services/web-api/overview/
[Web Client]:https://docs.nodinite.com/getting-started/overview/