fix: multi-byte character corruption when converting Buffers to strings by brb3 · Pull Request #3100 · redis/node-redis

Description

This PR addresses corruption of multi-byte characters when those characters span across two chunks during decoding.

This problem is described in issue #2993 and @msebire provided a fix (and test cases) back in July in this comment. This PR incorporates those fixes.

NOTE: I searched for previous PRs for this issue (thinking that @msebire may have made one themselves), but couldn't find any.


Checklist

  • Does npm test pass with this change (including linting)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?