code: def diff_toDelta(self, diffs):
      
      text = []
      for (op, data) in diffs:
        if op == self.DIFF_INSERT:
          # High ascii will raise UnicodeDecodeError.  Use Unicode instead.
          data = data.encode("utf-8")
          text.append("+" + urllib.quote(data, "!~*'();/?:@&=+$,# "))
        elif op == self.DIFF_DELETE:
          text.append("-%d" % len(data))
        elif op == self.DIFF_EQUAL:
          text.append("=%d" % len(data))
      return "\t".join(text)
docs: Crush the diff into an encoded string which describes the operations
      required to transform text1 into text2.
      E.g. =3\t-2\t+ing  -> Keep 3 chars, delete 2 chars, insert 'ing'.
      Operations are tab-separated.  Inserted text is escaped using %xx notation.
  
      Args:
        diffs: Array of diff tuples.
  
      Returns:
        Delta text.