node
node copied to clipboard
util: add a method to get string encoding info
util: Add a method to get the encoding information of a string.
Currently, we should check the encoding of the string before we use latin1WriteStatic
and ucs2Write
to write to the buffer.
This PR adds a method to return the encoding information from V8.
Refs: #56090