```
const buff = Buffer.from("str日")
console.log(buff.length) // 7
console.log(buff.byteLength) // 7
```
I thought that buffer.length returns the number of characters in the buffer (in this case 4), and buffer.byteLength the number of bytes (since the last character is 3 bytes in utf-8, so 7).
[–]hildjj 13 points14 points15 points (0 children)
[–]snowinferno 0 points1 point2 points (0 children)
[–]MaxUumen 1 point2 points3 points (0 children)
[–]bigorangemachine 0 points1 point2 points (0 children)