gbkEncode function

List<int> gbkEncode(
  1. String input
)

Implementation

List<int> gbkEncode(String input) {
  var ret = <int>[];
  input.codeUnits.forEach((charCode) {
    var char = String.fromCharCode(charCode);
    var gbkCode = _char_to_gbkCode[char];
    if (gbkCode != null) {
      ret.add(gbkCode);
    } else if (charCode != null) {
      ret.add(charCode);
    }
  });
  return ret;
}