# Python Function Node UnicodeDecodeError

**URL:** https://discourse.nodered.org/t/python-function-node-unicodedecodeerror/34986
**Category:** General
**Created:** [28 October 2020 21:28 UTC](https://discourse.nodered.org/t/python-function-node-unicodedecodeerror/34986 "2020-10-28T21:28:12Z")
**Posts on this page:** 1
**Showing post:** 13

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [30 October 2020 21:17 UTC](https://discourse.nodered.org/t/python-function-node-unicodedecodeerror/34986/13 "2020-10-30T21:17:44Z")

</div>

I thought I might have found the cause of the warning triangle. In javascript it is not recommended to use `for .. in ..` for iterating an array, though in practice it may work. The recommended way is to replace, for example  
`for (var letter in msg.payload)`  
with  
`for (var letter=0; letter<msg.payload.length; letter++)`  
But unfortunately it appears that it is not that which is confusing the syntax checker. I have started a new thread for that issue to see if we can get to the bottom of it: ["Too many errors" in function node, but works ok](https://discourse.nodered.org/t/too-many-errors-in-function-node-but-works-ok/35088)

---

_[View the full topic](https://discourse.nodered.org/t/python-function-node-unicodedecodeerror/34986)._
