1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-01-02 16:54:12 +01:00
Files
ebook-converter/ebook_converter/ebooks/rtf2xml/__init__.py
2020-04-11 19:27:06 +02:00

13 lines
337 B
Python

from __future__ import unicode_literals, absolute_import, print_function, division
import io
def open_for_read(path):
return io.open(path, encoding='utf-8', errors='replace')
def open_for_write(path, append=False):
mode = 'a' if append else 'w'
return io.open(path, mode, encoding='utf-8', errors='replace', newline='')