code: def _encode(s, encoding=None, errors=None):
      
      if encoding is None:
          encoding = ENCODING
      if errors is None:
          errors = ENCODING_ERRORS
      return s.encode(encoding, errors) if isinstance(s, unicode) else s
docs: Encodes *s*.