diff --git a/ifj2017/ide/core/file_io.py b/ifj2017/ide/core/file_io.py index 7c87967..a7d2729 100644 --- a/ifj2017/ide/core/file_io.py +++ b/ifj2017/ide/core/file_io.py @@ -37,14 +37,14 @@ def write(self, content: str) -> None: if not self._source: return - with open(self._source, "w") as f: - f.write(content) + with open(self._source, "wb") as f: + f.write(bytes(content, encoding='utf-8')) @pyqtSlot(result=str) def read(self) -> str: if not self._source: return "" - with open(self._source, "r") as f: + with open(self._source, "rb") as f: read_data = f.read() - return read_data \ No newline at end of file + return str(read_data, encoding='utf-8') \ No newline at end of file