method Socket.prototype.setEncodingSocket.prototype.setEncoding(encoding?: BufferEncoding): thisDeprecatedSet the encoding for the socket as a Readable Stream. See readable.setEncoding() for more information. Parametersoptionalencoding: BufferEncodingReturn TypethisThe socket itself.