encode static method
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;
}