encode static method

String encode(
  1. String string
)

Implementation

static String encode(String string) {
  var codePoints = _ucs2decode(string);
  var length = codePoints.length;
  var index = -1;
  int codePoint;
  var byteString = '';
  while (++index < length) {
    codePoint = codePoints[index];
    byteString += _encodeCodePoint(codePoint);
  }
  return byteString;
}