Node.js examples for String:Unicode
String to UTF8 Byte Array
if (typeof String.prototype.toUTF8ByteArray != 'function') String.prototype.toUTF8ByteArray = function() { var bytes = []; var s = unescape(encodeURIComponent(this)); for (var i = 0; i < s.length; i++) { var c = s.charCodeAt(i); bytes.push(c);/* w w w. j ava 2 s . c o m*/ } return bytes; };