# Special character conversion issues

**URL:** https://discourse.nodered.org/t/special-character-conversion-issues/75409
**Category:** General
**Created:** [19 February 2023 04:04 UTC](https://discourse.nodered.org/t/special-character-conversion-issues/75409 "2023-02-19T04:04:25Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![lucas3d](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lucas3d/32/16676_2.png) [@lucas3d](https://discourse.nodered.org/u/lucas3d)
#### Post date: [19 February 2023 04:04 UTC](https://discourse.nodered.org/t/special-character-conversion-issues/75409/1 "2023-02-19T04:04:25Z")

</div>

Hi everyone,

I'm working on a tool to convert a JSON file to specific text file formatting (Facebook Archive to Day One). It's working fine, but I have issues with accentuation (French language).

For example, "_\u00c3\u00a9t\u00c3\u00a9_" should convert to "_été_" but my flow convert it to "_Ã©tÃ©_"

It tried to play with node-red-contrib-iconv, but without success.

Any help will be welcome.

My flow:

```auto
[{"id":"15947a802a312bf0","type":"debug","z":"6cf7250c223824e5","name":"debug raw","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":650,"y":440,"wires":[]},{"id":"dce391c280522b44","type":"split","z":"6cf7250c223824e5","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":470,"y":520,"wires":[["15947a802a312bf0","6985f38d738df803"]]},{"id":"a507fc248d041d37","type":"debug","z":"6cf7250c223824e5","name":"debug 10","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":960,"y":520,"wires":[]},{"id":"6985f38d738df803","type":"function","z":"6cf7250c223824e5","name":"function 2","func":"var title = msg.payload.title;\nvar post = msg.payload.data[0].post;\nlet unix_timestamp = msg.payload.timestamp;\n\n// Create a new JavaScript Date object based on the timestamp\n// multiplied by 1000 so that the argument is in milliseconds, not seconds.\nvar d = new Date(unix_timestamp * 1000);\n \n// month as a number 0-11\nvar months = { 1: \"January\", 2: \"February\", 3: \"March\", 4: \"April\", 5: \"May\", 6: \"June\", 7: \"July\", 8: \"August\", 9: \"September\", 10: \"October\", 11: \"November\", 12: \"December\" };\nvar month = d.getMonth();\nvar month_name = months[month+1];\n\n//day as a number 1 -31\nvar day = d.getDate() \n\n//year as a four digit number (yyyy)\nvar year = d.getFullYear() \n\n// Hours part from the timestamp\nvar hours = d.getHours();\n\n// Minutes part from the timestamp\nvar minutes = \"0\" + d.getMinutes();\n\n// Seconds part from the timestamp\nvar seconds = \"0\" + d.getSeconds();\n\nvar date = '\\tDate:\\t' + month_name + ' ' + day + ', ' + year + ' at ' + hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);\n\n// Output\nmsg.payload = date + '\\n\\n# ' + title + '\\n\\n' + post + '\\n\\n';\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":640,"y":520,"wires":[["06730e2a861c88bb"]]},{"id":"06730e2a861c88bb","type":"join","z":"6cf7250c223824e5","name":"","mode":"custom","build":"string","property":"msg.payload","propertyType":"msg","key":"topic","joiner":"","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":810,"y":520,"wires":[["a507fc248d041d37"]]},{"id":"fd6e6be0ad9f9610","type":"inject","z":"6cf7250c223824e5","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[\t {\t \"timestamp\": 1395769972,\t \"attachments\": [\t \t],\t \"data\": [\t {\t \"post\": \"I'm starting to select and process my best shoots of my 1500 pictures...\\nMore pictures will come every day\"\t },\t {\t \"update_timestamp\": 1395769972\t }\t],\t \"title\": \"Lucas Janin shared an album.\"\t },\t {\t \"timestamp\": 1395812484,\t \"attachments\": [\t \t],\t \"data\": [\t {\t \"post\": \"Fin de f\\u00c3\\u00aate au #Bequinox \\n\\nCette photo a \\u00c3\\u00a9t\\u00c3\\u00a9 prise a 7 heures du matin avant le lever du soleil. Mes mod\\u00c3\\u00a8les avaient fait la fete toute la nuit...\\n\\nL'\\u00c3\\u00a9clairage a \\u00c3\\u00a9t\\u00c3\\u00a9 r\\u00c3\\u00a9aliser via un flash Quadra Elinchrom et un Deep Octa de 1 m\\u00c3\\u00a8tre. La lumi\\u00c3\\u00a8re naturel pour d\\u00c3\\u00a9boucher les hombres...\"\t },\t {\t \"update_timestamp\": 1395812484\t }\t],\t \"title\": \"Lucas Janin shared a photo.\"\t }\t]","payloadType":"jsonata","x":310,"y":520,"wires":[["dce391c280522b44"]]}]

```

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [19 February 2023 08:22 UTC](https://discourse.nodered.org/t/special-character-conversion-issues/75409/2 "2023-02-19T08:22:53Z")

</div>

If you try to set it up like this with iconv:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/c/fcbb21793d6b115667578b44c8d48b6ab6dc66db.png)

Result:

```auto
	Date:	March 25, 2014 at 18:52:52

# Lucas Janin shared an album.

I'm starting to select and process my best shoots of my 1500 pictures...
More pictures will come every day

	Date:	March 26, 2014 at 6:41:24

# Lucas Janin shared a photo.

Fin de fête au #Bequinox 

Cette photo a été prise a 7 heures du matin avant le lever du soleil. Mes modèles avaient fait la fete toute la nuit...

L'éclairage a été réaliser via un flash Quadra Elinchrom et un Deep Octa de 1 mètre. La lumière naturel pour déboucher les hombres...

```

---

<div class="post-metadata">

### Author: ![lucas3d](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lucas3d/32/16676_2.png) [@lucas3d](https://discourse.nodered.org/u/lucas3d)
#### Post date: [19 February 2023 14:45 UTC](https://discourse.nodered.org/t/special-character-conversion-issues/75409/3 "2023-02-19T14:45:03Z")

</div>

Work perfectly! Thanks for your help!!!

---

<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: [5 March 2023 14:45 UTC](https://discourse.nodered.org/t/special-character-conversion-issues/75409/4 "2023-03-05T14:45:30Z")

</div>

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