aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--markdown/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/markdown/__init__.py b/markdown/__init__.py
index 8bcfbc0..7ca6cd1 100644
--- a/markdown/__init__.py
+++ b/markdown/__init__.py
@@ -331,7 +331,7 @@ class Markdown:
if isinstance(input, basestring):
input_file = codecs.open(input, mode="r", encoding=encoding)
else:
- input_file = input
+ input_file = codecs.getreader(encoding)(input)
text = input_file.read()
input_file.close()
text = text.lstrip(u'\ufeff') # remove the byte-order mark