You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See binary strings for more background on this topic. The name of this encoding can be very misleading, as all of the encodings listed here convert between strings and binary data. For converting between strings and Buffers, typically 'utf8' is the right choice.
ucs2 and ucs-2 are both aliases to utf16le.
ascii is an alias in one direction but not another:
For 7-bit ASCII data only. When encoding a string into a Buffer, this is equivalent to using 'latin1'. When decoding a Buffer into a string, using this encoding will additionally unset the highest bit of each byte before decoding as 'latin1'. Generally, there should be no reason to use this encoding, as 'utf8' (or, if the data is known to always be ASCII-only, 'latin1') will be a better choice when encoding or decoding ASCII-only text. It is only provided for legacy compatibility.
The text was updated successfully, but these errors were encountered:
As of Node 18, there are 3 encodings that are simply aliases to another:
binary
is an alias forlatin1
ucs2
anducs-2
are both aliases toutf16le
.ascii
is an alias in one direction but not another:The text was updated successfully, but these errors were encountered: