node-red / node-red

Low-code programming for event-driven applications
http://nodered.org
Apache License 2.0
18.93k stars 3.31k forks source link

Replace dependency `is-utf8` #4766

Open Rotzbua opened 1 week ago

Rotzbua commented 1 week ago

Current Behavior

The dependency is-utf8 has it latest release 0.2.1 in 2015 and seems to have some issues: https://github.com/wayfind/is-utf8/issues/6

Expected Behavior

Use a maintained dependency or native implementation.

This project already uses websocket library ws which offers its own utf8 library utf-8-validate.

By increasing required node version to new patch level 18.5 -> 18.14 it is possible to use native implementation https://nodejs.org/docs/latest-v18.x/api/buffer.html#bufferisutf8input .

The native implementation would be preferable, but tests fail.

Environment