# UTF-8 to ISO-8859-1 for POST

**URL:** <https://community.n8n.io/t/utf-8-to-iso-8859-1-for-post/46225>\
**Category:** Questions\
**Created:** [May 17, 2024, 1:43pm UTC](https://community.n8n.io/t/utf-8-to-iso-8859-1-for-post/46225 "2024-05-17T13:43:01Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![smitterer](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/smitterer/32/29590_2.png) [@smitterer](https://community.n8n.io/u/smitterer)\
**Post date:** [May 17, 2024, 1:43pm UTC](https://community.n8n.io/t/utf-8-to-iso-8859-1-for-post/46225/1 "2024-05-17T13:43:01Z")

</div>

Hi everyone,

we are using n8n to transfer shipment data form our ERP to the logistics company.  
Unfortunately, special characters like ß, ü, ö and so on are not transferred to the logistics company as they need the POST request to be in ISO-8859-1.

Any idea how I could solve that?

Thanks

---

<div class="post-metadata">

**Author:** ![n8n](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/n8n/32/196425_2.png) [@n8n](https://community.n8n.io/u/n8n)\
**Post date:** [May 17, 2024, 1:43pm UTC](https://community.n8n.io/t/utf-8-to-iso-8859-1-for-post/46225/2 "2024-05-17T13:43:02Z")

</div>

It looks like your topic is missing some important information. Could you provide the following if applicable.

- **n8n version:**
- **Database (default: SQLite):**
- **n8n EXECUTIONS\_PROCESS setting (default: own, main):**
- **Running n8n via (Docker, npm, n8n cloud, desktop app):**
- **Operating system:**

---

<div class="post-metadata">

**Author:** ![smitterer](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/smitterer/32/29590_2.png) [@smitterer](https://community.n8n.io/u/smitterer)\
**Post date:** [May 17, 2024, 1:59pm UTC](https://community.n8n.io/t/utf-8-to-iso-8859-1-for-post/46225/3 "2024-05-17T13:59:28Z")

</div>

Sure,  
n8n version: 1.32.2  
Database: unchanged, so I guess SQLite  
n8n EXECUTIONS\_PROCESS setting: default  
Running in Docker on Synology NAS  
OS: Synology

---

<div class="post-metadata">

**Author:** ![ria](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ria/32/99251_2.png) [@ria](https://community.n8n.io/u/ria)\
**Post date:** [May 17, 2024, 3:32pm UTC](https://community.n8n.io/t/utf-8-to-iso-8859-1-for-post/46225/4 "2024-05-17T15:32:29Z")

</div>

Hi @smitterer

Thanks for posting here and welcome to the community! 🥳

Would you care to share your workflow? Are you using the HTTP Node for the data transfer?

> You can share your workflow here by pasting the JSON content (after you download the workflow from you workspace) in between two block quotes (`````).

---

<div class="post-metadata">

**Author:** ![smitterer](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/smitterer/32/29590_2.png) [@smitterer](https://community.n8n.io/u/smitterer)\
**Post date:** [May 18, 2024, 7:01am UTC](https://community.n8n.io/t/utf-8-to-iso-8859-1-for-post/46225/5 "2024-05-18T07:01:15Z")

</div>

Unfortunately I can hardly share the flow as it holds some sensitive data. (not only credentials but also one specific API is not open to the public)  
We use the HTTP node to get data from json in previous nodes and then post it to the API:

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/d/7/d78a0926c2d3703292c9446280ca68494fae5445.png)

---

<div class="post-metadata">

**Author:** ![smitterer](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/smitterer/32/29590_2.png) [@smitterer](https://community.n8n.io/u/smitterer)\
**Post date:** [May 22, 2024, 8:16am UTC](https://community.n8n.io/t/utf-8-to-iso-8859-1-for-post/46225/6 "2024-05-22T08:16:56Z")

</div>

@ria do you maybe have an idea?  
Thanks

---

<div class="post-metadata">

**Author:** ![ria](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ria/32/99251_2.png) [@ria](https://community.n8n.io/u/ria)\
**Post date:** [May 22, 2024, 5:11pm UTC](https://community.n8n.io/t/utf-8-to-iso-8859-1-for-post/46225/7 "2024-05-22T17:11:57Z")

</div>

Hi @smitterer

sorry for the late reply!

When sharing workflows the credentials are automatically excluded 😉

I was gonna see if I could use a **Code Node** to do the data encoding between your previous nodes and the **HTTP** Node to your logistics company.

---

<div class="post-metadata">

**Author:** ![smitterer](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/smitterer/32/29590_2.png) [@smitterer](https://community.n8n.io/u/smitterer)\
**Post date:** [May 22, 2024, 9:09pm UTC](https://community.n8n.io/t/utf-8-to-iso-8859-1-for-post/46225/8 "2024-05-22T21:09:12Z")

</div>

Unfortunately some of the nodes (like the http) directly hold sensitive data.

We try to use the following code to change the encoding, whichs works with then using “Convert to File” (with the correct encoding selected) and after that “Read/Write files from disk”.

> function encodeToISO88591(str) {  
> return Buffer.from(str, ‘utf8’).toString(‘binary’);  
> }
> 
> function encodeObject(obj) {  
> for (const key in obj) {  
> if (obj.hasOwnProperty(key)) {  
> if (typeof obj[key] === ‘string’) {  
> obj[key] = encodeToISO88591(obj[key]);  
> } else if (typeof obj[key] === ‘object’ && obj[key] !== null) {  
> obj[key] = encodeObject(obj[key]);  
> }  
> }  
> }  
> return obj;  
> }
> 
> // Get the input data  
> const inputData = items.map(item =\> item.json);
> 
> // Encode all values in the input data  
> const encodedData = inputData.map(data =\> encodeObject(data));
> 
> // Return the encoded data  
> return encodedData.map(data =\> ({ json: data }));

Using the following headers in the http node does not work unfortunately:

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/7/8/7855a07deb587e116ecad36752e14a444edd89b8.png)

---

<div class="post-metadata">

**Author:** ![smitterer](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/smitterer/32/29590_2.png) [@smitterer](https://community.n8n.io/u/smitterer)\
**Post date:** [May 27, 2024, 6:50pm UTC](https://community.n8n.io/t/utf-8-to-iso-8859-1-for-post/46225/9 "2024-05-27T18:50:04Z")

</div>

@ria do you maybe have any idea?

Thanks!

---

<div class="post-metadata">

**Author:** ![smitterer](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/smitterer/32/29590_2.png) [@smitterer](https://community.n8n.io/u/smitterer)\
**Post date:** [June 5, 2024, 7:31am UTC](https://community.n8n.io/t/utf-8-to-iso-8859-1-for-post/46225/10 "2024-06-05T07:31:38Z")

</div>

@ria I’d really appreciate if you had an idea.  
Thanks

---

<div class="post-metadata">

**Author:** ![smitterer](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/smitterer/32/29590_2.png) [@smitterer](https://community.n8n.io/u/smitterer)\
**Post date:** [July 9, 2024, 6:34am UTC](https://community.n8n.io/t/utf-8-to-iso-8859-1-for-post/46225/11 "2024-07-09T06:34:45Z")

</div>

@ria any idea?

Thank you

---

<div class="post-metadata">

**Author:** ![Paulo\_Augusto](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/paulo_augusto/32/14585_2.png) [@Paulo\_Augusto](https://community.n8n.io/u/Paulo_Augusto)\
**Post date:** [July 15, 2024, 12:49am UTC](https://community.n8n.io/t/utf-8-to-iso-8859-1-for-post/46225/12 "2024-07-15T00:49:35Z")

</div>

Set the http request node to save file. (Response / Response Format = file / Put Output in Field = data.

Add a “code” node

const iconv = require(‘iconv-lite’);  
const fileData = items[0].binary.data;  
const binaryData = Buffer.from(fileData.data, ‘base64’);  
const decodedContent = iconv.decode(binaryData, ‘iso-8859-1’);  
return [  
{  
json: {  
data: decodedContent  
}  
}  
];

---

<div class="post-metadata">

**Author:** ![netroy](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/netroy/32/22154_2.png) [@netroy](https://community.n8n.io/u/netroy)\
**Post date:** [July 15, 2024, 7:10am UTC](https://community.n8n.io/t/utf-8-to-iso-8859-1-for-post/46225/13 "2024-07-15T07:10:26Z")

</div>

We improved our handling of `ISO-8859-1` responses [4 days ago](https://github.com/n8n-io/n8n/pull/9869). Once this fix is out on Wednesday, can you please try to upgrade, and also set the `Content-Type` to include `charset=latin1` on your requests we well?

We might still need to update a few other nodes to make them all respect the response encoding. So if this is about a specific node, please let us know, and we’ll try to prioritize updating that node’s response handling.

---

<div class="post-metadata">

**Author:** ![smitterer](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/smitterer/32/29590_2.png) [@smitterer](https://community.n8n.io/u/smitterer)\
**Post date:** [July 17, 2024, 9:18am UTC](https://community.n8n.io/t/utf-8-to-iso-8859-1-for-post/46225/14 "2024-07-17T09:18:24Z")

</div>

Thanks a lot for your reply and the commit.

How do I see in which release this is included? I don’t see it in 1.50.1  
Is there a 1.50.2 planned for today?

Thanks

---

<div class="post-metadata">

**Author:** ![netroy](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/netroy/32/22154_2.png) [@netroy](https://community.n8n.io/u/netroy)\
**Post date:** [July 17, 2024, 10:54am UTC](https://community.n8n.io/t/utf-8-to-iso-8859-1-for-post/46225/15 "2024-07-17T10:54:03Z")

</div>

This hasn’t gone out yet. It’s included in 1.51.0, that’s building right now.

> [@smitterer](#):
>
> How do I see in which release this is included? I don’t see it in 1.50.1

Once the PR is released, there will be a comment from Jan on the PR mentioning the release that particular PR went out in.

---

<div class="post-metadata">

**Author:** ![ria](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ria/32/99251_2.png) [@ria](https://community.n8n.io/u/ria)\
**Post date:** [July 17, 2024, 2:33pm UTC](https://community.n8n.io/t/utf-8-to-iso-8859-1-for-post/46225/16 "2024-07-17T14:33:23Z")

</div>

Hi @smitterer

Just got released with [`n8n@1.51.0`](https://github.com/n8n-io/n8n/releases/tag/n8n%401.51.0)

> <https://github.com/n8n-io/n8n/pull/9869>
>
> \## Summary
> Almost all of our response handling code in nodes was ignoring the e…ncoding defined on the \`content-type\` header. This PR updates all of this code to respect the encoding of the original document.
> 
> Before the fix:
> !\[image\](https://github.com/n8n-io/n8n/assets/196144/c1830d65-a540-48be-87ce-f6dc49d20bcc)
> 
> After the fix:
> !\[image\](https://github.com/n8n-io/n8n/assets/196144/0dd6f197-17a6-4007-a1b8-4cffe8bda385)
> 
> PS: This does not fix the issue in v1 and v2 of the HttpRequest node. I tried, but it turned out to be too messy to be worth fixing.
> 
> \## Related Linear tickets, Github issues, and Community forum posts
> Fixes #8799
> 
> \## Review / Merge checklist
> 
> \- \[x\] PR title and summary are descriptive
> \- \[x\] Tests included

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [October 15, 2024, 2:33pm UTC](https://community.n8n.io/t/utf-8-to-iso-8859-1-for-post/46225/17 "2024-10-15T14:33:59Z")

</div>

Closed on October 15, 2024, 2:33pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
