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