# Converter decimal 16 bits to UFT-8

**URL:** https://discourse.nodered.org/t/converter-decimal-16-bits-to-uft-8/60883
**Category:** General
**Created:** [6 April 2022 14:28 UTC](https://discourse.nodered.org/t/converter-decimal-16-bits-to-uft-8/60883 "2022-04-06T14:28:45Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![bparra](https://avatars.discourse-cdn.com/v4/letter/b/47e85d/32.png) [@bparra](https://discourse.nodered.org/u/bparra)
#### Post date: [6 April 2022 14:28 UTC](https://discourse.nodered.org/t/converter-decimal-16-bits-to-uft-8/60883/1 "2022-04-06T14:28:45Z")

</div>

Hi,

I receive this array, it's a decimal 16 bits and I need to convert it to UFT-8 text  
 ![Capturar](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/3/c37f31ccb6da385ebcde5e099e1a389a5c8bb6e7.png)  
It converted should show the date 06/04/22  
How can I do this?

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [6 April 2022 16:17 UTC](https://discourse.nodered.org/t/converter-decimal-16-bits-to-uft-8/60883/2 "2022-04-06T16:17:35Z")

</div>

You can use a function node and write the 3 values as Int16 Big Endian then call toString to convert the buffer back to a string.

or

use `node-red-contrib-buffer-parser`

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

```auto
[{"id":"88936db8a9d97190","type":"inject","z":"1bd2b382.4dd4f4","name":"[13872,12335,12084,12850,0]","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[13872,12335,12084,12850,0]","payloadType":"json","x":920,"y":1088,"wires":[["ecdca6d950e0daa8"]]},{"id":"ecdca6d950e0daa8","type":"buffer-parser","z":"1bd2b382.4dd4f4","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"string","name":"item1","offset":0,"length":-1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"value","resultTypeType":"return","multipleResult":true,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":1158,"y":1088,"wires":[["0cdd2843660a2bd5"]]},{"id":"0cdd2843660a2bd5","type":"debug","z":"1bd2b382.4dd4f4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1338,"y":1088,"wires":[]}]

```

---

<div class="post-metadata">

### Author: ![bparra](https://avatars.discourse-cdn.com/v4/letter/b/47e85d/32.png) [@bparra](https://discourse.nodered.org/u/bparra)
#### Post date: [6 April 2022 17:17 UTC](https://discourse.nodered.org/t/converter-decimal-16-bits-to-uft-8/60883/3 "2022-04-06T17:17:46Z")

</div>

Thank you very much

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/9/19015a8fb6977b838ebfc7f8d240e009b844a473.png)

---

<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: [20 April 2022 17:18 UTC](https://discourse.nodered.org/t/converter-decimal-16-bits-to-uft-8/60883/4 "2022-04-20T17:18:41Z")

</div>

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