# Umlauts in mail csv-attachment content

**URL:** https://discourse.nodered.org/t/umlauts-in-mail-csv-attachment-content/54469
**Category:** General
**Created:** [29 November 2021 16:28 UTC](https://discourse.nodered.org/t/umlauts-in-mail-csv-attachment-content/54469 "2021-11-29T16:28:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Andreas703](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andreas703/32/26326_2.png) [@Andreas703](https://discourse.nodered.org/u/Andreas703)
#### Post date: [29 November 2021 16:28 UTC](https://discourse.nodered.org/t/umlauts-in-mail-csv-attachment-content/54469/1 "2021-11-29T16:28:11Z")

</div>

Hi, I am sending me log files every day as backup.  
If I am sending it as csv there are problems with the encoding and all umlauts like ö,ä,ü and so on arent readable.  
If I am sending the same text as .txt it works.

The file which I save with NodeRed works too.

The Input looks like:

`{"Alarmnummer":"032","Schrittzaehler":0,"IDALL":0,"Reihungszeit":20,"Alarmtext":"24V_Störung","aktiv":false,"deactivate":false,"deactivatedate":"26.11.2021"}, {"Alarmnummer":"033","Schrittzaehler":0,"IDALL":0,"Reihungszeit":20,"Alarmtext":"Batterie MIN","aktiv":false,"deactivate":false,"deactivatedate":"26.11.2021"},`

My code for the attachments look like this:

```auto
attachments=[];
for(var i=0;i<msg.payload.length;i++)
{
    attachments.push({filename:msg.payload[i].path.substring( msg.payload[i].path.lastIndexOf("/") + 1, msg.payload[i].path.lastIndexOf("."))+".txt",content:msg.payload[i].payload.replace(/},/g, "},\n")});

}

msg.attachments=attachments;

```

Is there a solution?

---

<div class="post-metadata">

### Author: ![Andreas703](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andreas703/32/26326_2.png) [@Andreas703](https://discourse.nodered.org/u/Andreas703)
#### Post date: [30 November 2021 07:10 UTC](https://discourse.nodered.org/t/umlauts-in-mail-csv-attachment-content/54469/2 "2021-11-30T07:10:07Z")

</div>

After my research I know now, that it is an Excel problem. Excel want to have "windows-1252" and I am reading it as utf-8. Is there a way to code it in windows-1252?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [29 January 2022 07:10 UTC](https://discourse.nodered.org/t/umlauts-in-mail-csv-attachment-content/54469/3 "2022-01-29T07:10:18Z")

</div>

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