code: def to_lxml_encoding(encoding):
      '''Check if lxml supports the specified encoding.
  
      Returns:
          str, None
      '''
      # XXX: Workaround lxml not liking utf-16-le
      try:
          lxml.html.HTMLParser(encoding=encoding)
      except LookupError:
          encoding = encoding.replace('-', '')
      else:
          return encoding
      try:
          lxml.html.HTMLParser(encoding=encoding)
      except LookupError:
          encoding = encoding.replace('_', '')
      else:
          return encoding
  
      try:
          lxml.html.HTMLParser(encoding=encoding)
      except LookupError:
          pass
      else:
          return encodinf to_lxml_encoding(encoding):
      '''Check if lxml supports the specified encoding.
  
      Returns:
          str, None
      '''
      # XXX: Workaround lxml not liking utf-16-le
      try:
          lxml.html.HTMLParser(encoding=encoding)
      except LookupError:
          encoding = encoding.replace('-', '')
      else:
          return encoding
      try:
          lxml.html.HTMLParser(encoding=encoding)
      except LookupError:
          encoding = encoding.replace('_', '')
      else:
          return encoding
  
      try:
          lxml.html.HTMLParser(encoding=encoding)
      except LookupError:
          pass
      else:
          return encoding
docs: Check if lxml supports the specified encoding.
  
      Returns:
          str, None