gbkDecode function

String gbkDecode(
  1. List<int> input
)

Implementation

String gbkDecode(List<int> input) {
  var ret = '';
  /*
  List<int> combined =  List<int>();
  int id= 0;
  while(id<input.length) {
      int charCode = input[id];
      id ++;
      if (charCode < 0x80 || charCode > 0xffff || id == input.length) {
        combined.add(charCode);
      } else {
        charCode = (charCode << 8) + input[id];
        id ++;
        combined.add(charCode);
      }
  }
  */
  input.forEach((charCode) {
    var char = _gbkCode_to_char[charCode];
    if (char != null) {
      ret += char;
    } else {
      ret += String.fromCharCode(charCode);
    }
    //print(ret);
  });
  return ret;
}