code: def set_encoding (parsobj, attrs):
      
      charset = attrs.get_true('charset', u'')
      if charset:
          # <meta charset="utf-8">
          # eg. in http://cn.dolphin-browser.com/activity/Dolphinjump
          charset = charset.encode('ascii', 'ignore').lower()
      elif attrs.get_true('http-equiv', u'').lower() == u"content-type":
          # <meta http-equiv="content-type" content="text/html;charset="utf-8">
          charset = attrs.get_true('content', u'')
          charset = charset.encode('ascii', 'ignore').lower()
          charset = get_ctype_charset(charset)
      if charset and charset in SUPPORTED_CHARSETS:
          parsobj.encoding = charset
docs: Set document encoding for the HTML parser according to the <meta>
      tag attribute information.
  
      @param attrs: attributes of a <meta> HTML tag
      @type attrs: dict
      @return: None