I'm trying to understand the implementation of the latin1 encoding in the node.js Buffer implementation.In latin1, each character is represented by 1 byte.
When I try to encode a character that lies outside of the range, for example 😎:
Buffer.alloc(4, "😎", "latin1")
I get this buffer:
<Buffer 3d 0e 3d 0e>
I was expecting some kind of encoding error instead.Those bytes aren't even the UTF-8 encoding, which would be <Buffer f0 9f 98 08>
Does anyone have an idea how node.js handles these out of range cases?The node version is 18.19.0.
Thanks!