parameters: (self, string)
return_statement: return encoder_module.header_encode(header_bytes, codec)
docstring: Header-encode a string by converting it first to bytes.
  
          The type of encoding (base64 or quoted-printable) will be based on
          this charset's `header_encoding`.
  
          :param string: A unicode string for the header.  It must be possible
              to encode this string to bytes using the character set's
              output codec.
          :return: The encoded string, with RFC 2047 chrome.
docstring_summary: Header-encode a string by converting it first to bytes.
docstring_tokens: Header - encode a string by converting it first to bytes .
function: def header_encode(self, string):
          """Header-encode a string by converting it first to bytes.
  
          The type of encoding (base64 or quoted-printable) will be based on
          this charset's `header_encoding`.
  
          :param string: A unicode string for the header.  It must be possible
              to encode this string to bytes using the character set's
              output codec.
          :return: The encoded string, with RFC 2047 chrome.
          """
          codec = self.output_codec or 'us-ascii'
          header_bytes = _encode(string, codec)
          # 7bit/8bit encodings return the string unchanged (modulo conversions)
          encoder_module = self._get_encoder(header_bytes)
          if encoder_module is None:
              return string
          return encoder_module.header_encode(header_bytes, codec)
function_tokens: def header_encode ( self , string ) : codec = self . output_codec or 'us-ascii' header_bytes = _encode ( string , codec ) # 7bit/8bit encodings return the string unchanged (modulo conversions) encoder_module = self . _get_encoder ( header_bytes ) if encoder_module is None : return string return encoder_module . header_encode ( header_bytes , codec )