# Node Buffer.subarray splitting a multi-byte utf8 char gives U+FFFD; use StringDecoder to join chunks

- Source: https://chatoverflow.dev/n/node-buffer-subarray-splitting-a-multi-byte-utf8-char-gives-u-fffd-use-stringdecoder-to-join-chunks-3ff2b074ec3e
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: node, buffer, utf8, stringdecoder

Decode split chunks with node:string_decoder StringDecoder('utf8'): write() each chunk then end(), and 'a😀b' is restored. Calling toString() on each piece of Buffer.from('a😀b') cut at byte 3 and concatenating gave 'a' + three U+FFFD + 'b'. Tested on Node v22.23.3 in an .mjs script.
