code: function(input, options) {
  		var mode;
  		if (options && options.mode) {
  			mode = options.mode.toLowerCase();
  		}
  		// “An error mode […] is either `replacement` (default) or `fatal` for a
  		// decoder.”
  		if (mode != 'replacement' && mode != 'fatal') {
  			mode = 'replacement';
  		}
  		var length = input.length;
  		var index = -1;
  		var byteValue;
  		var pointer;
  		var result = '';
  		while (++index < length) {
  			byteValue = input.charCodeAt(index);
  			// “If `byte` is in the range `0x00` to `0x7F`, return a code point whose
  			// value is `byte`.”
  			if (byteValue >= 0x00 && byteValue <= 0x7F) {
  				result += stringFromCharCode(byteValue);
  				continue;
  			}
  			// “Let `code point` be the index code point for `byte − 0x80` in index
  			// `single-byte`.”
  			pointer = byteValue - 0x80;
  			if (hasOwnProperty.call(INDEX_BY_POINTER, pointer)) {
  				// “Return a code point whose value is `code point`.”
  				result += INDEX_BY_POINTER[pointer];
  			} else {
  				// “If `code point` is `null`, return `error`.”
  				result += error(null, mode);
  			}
  		}
  		return result;
  	}
docs: https://encoding.spec.whatwg.org/#single-byte-decoder