Encode string as UTF8 - Node.js String

Node.js examples for String:Unicode

Description

Encode string as UTF8

Demo Code

exports.encodeCString = function(string) {
  var buf = new Buffer(string, 'utf8');
  return [buf, new Buffer([0])];
}

Related Tutorials