code: def encode(self, s):
          
          if isinstance(s, str) and self.needsEncoding(s):
              for x in self.encodings:
                  s = re.sub(x[0], x[1], s)
          return s
docs: Encode special characters found in string I{s}.
          @param s: A string to encode.
          @type s: str
          @return: The encoded string.
          @rtype: str