fork download
  1. process.stdin.resume();
  2. process.stdin.setEncoding('utf8');
  3.  
  4. const str1 = Buffer([0,1,2,3,4,5,128,192,255]).toString("ASCII");
  5. const str2 = Buffer([0,1,2,3,4,5,128,192,255]).toString("latin1");
  6.  
  7. console.log(str1.length, str1);
  8. console.log(str2.length, str2);
Success #stdin #stdout #stderr 0.05s 43824KB
stdin
Standard input is empty
stdout
9 @
9 €Àÿ
stderr
(node:918648) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)