From 50eb66d6d1796a10726c013191cdf95638419f0f Mon Sep 17 00:00:00 2001 From: Travis Parker Date: Sat, 25 Jun 2011 15:20:36 -0700 Subject: also respect encoding when reading from a user-provided file --- markdown/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3