Formula - convert
Easily convert string encodings using the Nodinite convert
Formula plugin. This page shows how to transform data between different character encodings from message Content, Context, or the output of other formulas.
🎯 Designed for business users and integrators — no developer required; you can even use AI to craft expressions.
- ✅ Convert data between encodings from any Payload or Context in any Log Event
- ✅ Transform between character encodings like UTF-8, ISO-8859-1, and more
- ✅ Fix garbled characters and ensure data integrity in Nodinite Log Views, search filters, and self-service diagnostics
- ✅ Combine with other Formula functions for powerful, layered expressions
What does the convert Formula do?
The convert('SourceEncoding', 'TargetEncoding', Content)
Formula function transforms any string from a specified source encoding to a target encoding. This is essential when integrating systems that use different character sets, ensuring your data is always readable and accurate.
How it works: Input ➜ convert ➜ Result
Flow: The text content is converted from the source character encoding to the target character encoding.
Example: Fixing Garbled Characters
Suppose you receive a message with incorrectly displayed characters due to encoding issues. Here’s how you can fix it:
Input
Skellefteå
Formula Expression
convert('iso-8859-1', 'UTF-8', body)
Result
---
## Examples
### Example 1: Fixing garbled characters
#### *Input*
Message body is `Skellefteå`
#### *Formula Expression*
```xpath
convert('iso-8859-1', 'UTF-8', body)
Result
Skellefteå
Example 2: Convert context value encoding
Input
Message context contains a property CityName
with value Malmö
Formula Expression
convert('UTF-8', 'iso-8859-1', context('CityName'))
Result
Malmö
Features
Important
The
convert
Formula transforms any string from a specified source encoding to a target encoding, ensuring data integrity across integrated systems. This function loads the entire message into RAM—use on small messages only.
- Flexible Inputs: Convert from message body, Context, or the result of another Formula
- Encoding Support: Transform between encodings like UTF-8, ISO-8859-1, and more (see List of encodings)
- Fix Garbled Text: Correct incorrectly displayed characters due to encoding mismatches
- Composable: Combine with other Formula functions for advanced transformations
- Self-Service: Let business users fix encoding issues without developer intervention
How to use
To use the convert
Formula in a Search Field Expression:
- Open your Nodinite Web Client
- Navigate to Administration → Search Fields
- Create or edit a Search Field
- Choose Formula as the expression type
- Enter one of the following Syntax patterns
Syntax
Convert message body:
convert('source encoding', 'target encoding', body)
Convert message context property:
convert('source encoding', 'target encoding', context('PropertyName'))
Convert with nested formula:
convert('source encoding', 'target encoding', SomeOtherFunction(Content))
Example with specific encodings:
convert('iso-8859-1', 'UTF-8', body)
Next step
- Learn how to create a Search Field with an Expression
Related Topics
- Search Field
- Search Field Expressions
- Formula
- The base64encode Formula
- The base64decode Formula
- The toLower Formula
- The toUpper Formula