diff options
Diffstat (limited to 'bsie/reader/document/_plain.py')
-rw-r--r-- | bsie/reader/document/_plain.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bsie/reader/document/_plain.py b/bsie/reader/document/_plain.py index a589265..8ea3c43 100644 --- a/bsie/reader/document/_plain.py +++ b/bsie/reader/document/_plain.py @@ -20,6 +20,7 @@ __all__: typing.Sequence[str] = ( ## code ## class Plain(base.Reader): + """Read paragraphs (seperated by newline) from a plain text file.""" _match: filematcher.Matcher @@ -32,7 +33,7 @@ class Plain(base.Reader): raise errors.UnsupportedFileFormatError(path) # open file in text mode - with open(path, 'rt') as ifile: + with open(path, 'rt', encoding='UTF-8') as ifile: return [line.strip() for line in ifile.read().split('\n') if len(line.strip()) > 0] ## EOF ## |