 last code unit is a leadsurrogate.
    &#47;&#47; Force encoding of the lead surrogate by itself.
    var lastCodeUnit = string.codeUnitAt(end - 1);
    assert(_isLeadSurrogate(lastCodeUnit));
    &#47;&#47; We use a non-surrogate as `nextUnit` so that _writeSurrogate just
    &#47;&#47; writes the lead-surrogate.
    var wasCombined = encoder._writeSurrogate(lastCodeUnit, 0);
    assert(!wasCombined);
  }
  return encoder._buffer.sublist(0, encoder._bufferIndex);
}</code></pre>
    </section>

  </div> <!