title: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte - even though I opened the file in mode 'rb'
body: <p>I'm trying to write an HTTP server, but it doesn't matter.
  When I try to decode an image data (after writing 'data = file.read()', it gives an error:
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte</p>
  
  <p>I opened the file in 'rb' mode.
  Other people usually open the file in 'r' mode and that causes the error. But what is the error here?</p>
  
  <p>What is the problem???</p>
  
  <pre><code>def get_content_file(file_path):
      """
      Gets a full path to a file and returns the content of it.
      file_path must be a valid path.
      :param file_path: str (path)
      :return: str (data)
      """
  
      print(file_path)
      file = open(file_path, 'rb')
      data = file.read()
      file.close()
      return data.decode()
  </code></pre>