def ReadFile(path, encoding='utf-8'):
  """Reads data from a file.

  Args:
    path: The path of the file to read.
    encoding: Same param as open(). Set to None for binary mode.
  """
  with open(path, mode='r' if encoding else 'rb', encoding=encoding) as f:
    return f.read()