"use strict";
const { TextEncoder, TextDecoder } = require("util");

const utf8Encoder = new TextEncoder();
const utf8Decoder = new TextDecoder("utf-8", { ignoreBOM: true });

function utf8Encode(string) {
  return utf8Encoder.encode(string);
}

function utf8DecodeWithoutBOM(bytes) {
  return utf8Decoder.decode(bytes);
}

module.exports = {
  utf8Encode,
  utf8DecodeWithoutBOM
};

@@ -7,20 +7,18 @@
 trict%22;%0A
-cons
+le
 t %7B Text
@@ -58,16 +58,267 @@
 %22util%22);
+%0A// Handle browserify's lack of support (https://github.com/browserify/node-util/issues/46), which%0A// is important for the live viewer:%0Aif (!TextEncoder) %7B%0A  TextEncoder = global.TextEncoder;%0A%7D%0Aif (!TextDecoder) %7B%0A  TextDecoder = global.TextDecoder;%0A%7D
 %0A%0Aconst 

Fix the live viewer