# Problem decoding python3-function node - 'utf-32-le' codec can't decode bytes in position 16-19: code point not in range(0x110000)

**URL:** <https://discourse.nodered.org/t/problem-decoding-python3-function-node-utf-32-le-codec-cant-decode-bytes-in-position-16-19-code-point-not-in-range-0x110000/86729>\
**Category:** General\
**Created:** [25 March 2024 09:22 UTC](https://discourse.nodered.org/t/problem-decoding-python3-function-node-utf-32-le-codec-cant-decode-bytes-in-position-16-19-code-point-not-in-range-0x110000/86729 "2024-03-25T09:22:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![postek1313](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/postek1313/32/89595_2.png) [@postek1313](https://discourse.nodered.org/u/postek1313)\
**Post date:** [25 March 2024 09:22 UTC](https://discourse.nodered.org/t/problem-decoding-python3-function-node-utf-32-le-codec-cant-decode-bytes-in-position-16-19-code-point-not-in-range-0x110000/86729/1 "2024-03-25T09:22:13Z")

</div>

Hello,

I have a problem with executing a task using Python3-function in Node-RED. When using the simplest default Python node, I encounter errors like this:

```auto
File "C:\Program Files (x86)\Python39-32\lib\json\ __init__.py", line 341, in loads*

s = s.decode(detect_encoding(s), 'surrogatepass')***File "C:\Program Files (x86)\Python39-32\lib\encodings\utf_32_le.py", line 11, in decode***
return codecs.utf_32_le_decode(input, errors, True)***
UnicodeDecodeError: 'utf-32-le' codec can't decode bytes in position 16-19: code point not in range(0x110000)

```

It seems that the Python node cannot use UTF-32-LE, but I have tried converting texts to UTF-8, UTF-16, and even with an empty node that only returns `return 0`, the same error occurs.

I have already tried installing different versions of Python (3.9, 3.10, 3.12) hoping it's a compatibility issue between the node and Python version, but the same error occurs every time. I have also installed it on two different computers, but the result is exactly the same...

Programs in PyCharm and other Python IDEs work correctly. I checked `locale.getpreferredencoding()` to see the preferred encoding in my IDE, and I got `cp1250`.

Python3 - 3.9, 3.10, 3.12  
Node-Red- V3.1.7  
NodeJS -V20.11.1

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/2/124bed0df8f1b9da61e9051ee917986c2a7e9a53.png)

I'm out of ideas on what might be causing the problem. Can you help?

---

<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:** [25 March 2024 18:01 UTC](https://discourse.nodered.org/t/problem-decoding-python3-function-node-utf-32-le-codec-cant-decode-bytes-in-position-16-19-code-point-not-in-range-0x110000/86729/2 "2024-03-25T18:01:35Z")

</div>

Welcome to the forum @postek1313

Many have problems with the python nodes. The best solution is to convert the python source to JavaScript, or, if that cannot be done, to call a python script using an exec node.

---

<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:** [23 June 2024 18:02 UTC](https://discourse.nodered.org/t/problem-decoding-python3-function-node-utf-32-le-codec-cant-decode-bytes-in-position-16-19-code-point-not-in-range-0x110000/86729/3 "2024-06-23T18:02:25Z")

</div>

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