constguessed=jschardet.detect(buffer.slice(0,AUTO_ENCODING_GUESS_MAX_BYTES));// ensure to limit buffer for guessing due to https://github.com/aadsm/jschardet/issues/53
constguessed=jschardet.detect(Buffer.from(buffer.slice(0,AUTO_ENCODING_GUESS_MAX_BYTES).buffer));// ensure to limit buffer for guessing due to https://github.com/aadsm/jschardet/issues/53