code: function (string) {
           // TextEncoder + Uint8Array to binary string is faster than checking every bytes on long strings.
           // http://jsperf.com/utf8encode-vs-textencoder
           // On short strings (file names for example), the TextEncoder API is (currently) slower.
           if (JSZip.support.uint8array && typeof TextEncoder === "function") {
              var u8 = TextEncoder("utf-8").encode(string);
              return JSZip.utils.transformTo("string", u8);
           }
           if (JSZip.support.nodebuffer) {
              return JSZip.utils.transformTo("string", new Buffer(string, "utf-8"));
           }
  
           // array.join may be slower than string concatenation but generates less objects (less time spent garbage collecting).
           // See also http://jsperf.com/array-direct-assignment-vs-push/31
           var result = [], resIndex = 0;
  
           for (var n = 0; n < string.length; n++) {
  
              var c = string.charCodeAt(n);
  
              if (c < 128) {
                 result[resIndex++] = String.fromCharCode(c);
              } else if ((c > 127) && (c < 2048)) {
                 result[resIndex++] = String.fromCharCode((c >> 6) | 192);
                 result[resIndex++] = String.fromCharCode((c & 63) | 128);
              } else {
                 result[resIndex++] = String.fromCharCode((c >> 12) | 224);
                 result[resIndex++] = String.fromCharCode(((c >> 6) & 63) | 128);
                 result[resIndex++] = String.fromCharCode((c & 63) | 128);
              }
  
           }
  
           return result.join("");
        }
docs: http://www.webtoolkit.info/javascript-utf8.html