parameters: (self, file_name)
docstring: Reads the first few bytes from file_name and tries to guess the text
      encoding. Returns None as a guess if it can't detect it.
docstring_summary: Reads the first few bytes from file_name and tries to guess the text
      encoding. Returns None as a guess if it can't detect it.
docstring_tokens: Reads the first few bytes from file_name and tries to guess the text encoding . Returns None as a guess if it can t detect it .
function: def _DetectInputEncoding(self, file_name):
      """Reads the first few bytes from file_name and tries to guess the text
      encoding. Returns None as a guess if it can't detect it."""
      fp = open(file_name, 'rb')
      try:
        header = fp.read(3)
      except:
        fp.close()
        return None
      fp.close()
      if header.startswith("\xFE\xFF"):
        return "UTF-16"
      elif header.startswith("\xFF\xFE"):
        return "UTF-16"
      elif header.startswith("\xEF\xBB\xBF"):
        return "UTF-8"
      else:
        return None
function_tokens: def _DetectInputEncoding ( self , file_name ) : fp = open ( file_name , 'rb' ) try : header = fp . read ( 3 ) except : fp . close ( ) return None fp . close ( ) if header . startswith ( "\xFE\xFF" ) : return "UTF-16" elif header . startswith ( "\xFF\xFE" ) : return "UTF-16" elif header . startswith ( "\xEF\xBB\xBF" ) : return "UTF-8" else : return None