code: function adjustPos(orig, folded, pos) {
      if (orig.length == folded.length) return pos;
      for (var pos1 = Math.min(pos, orig.length);;) {
        var len1 = orig.slice(0, pos1).toLowerCase().length;
        if (len1 < pos) ++pos1;
        else if (len1 > pos) --pos1;
        else return pos1;
      }
    }
docs: Maps a position in a case-folded line back to a position in the original line (compensating for codepoints increasing in number during folding)