diff options
author | Travis Parker <travis.parker@gmail.com> | 2011-06-25 15:20:36 -0700 |
---|---|---|
committer | Travis Parker <travis.parker@gmail.com> | 2011-06-25 15:20:36 -0700 |
commit | 50eb66d6d1796a10726c013191cdf95638419f0f (patch) | |
tree | da73ab11296231af0f3dc79750e50460590d9b47 | |
parent | 4f11e375ad775d562b24482e22b7aa8d3a4ac936 (diff) | |
download | markdown-50eb66d6d1796a10726c013191cdf95638419f0f.tar.gz markdown-50eb66d6d1796a10726c013191cdf95638419f0f.tar.bz2 markdown-50eb66d6d1796a10726c013191cdf95638419f0f.zip |
also respect encoding when reading from a user-provided file
-rw-r--r-- | markdown/__init__.py | 2 |
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 |