diff options
author | Waylan Limberg <waylan@gmail.com> | 2011-06-27 08:50:14 -0700 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2011-06-27 08:50:14 -0700 |
commit | 9b26d2b5e567f0c18ed9ef88ee4f3d82bb4092cf (patch) | |
tree | da73ab11296231af0f3dc79750e50460590d9b47 | |
parent | 4f11e375ad775d562b24482e22b7aa8d3a4ac936 (diff) | |
parent | 50eb66d6d1796a10726c013191cdf95638419f0f (diff) | |
download | markdown-9b26d2b5e567f0c18ed9ef88ee4f3d82bb4092cf.tar.gz markdown-9b26d2b5e567f0c18ed9ef88ee4f3d82bb4092cf.tar.bz2 markdown-9b26d2b5e567f0c18ed9ef88ee4f3d82bb4092cf.zip |
Merge pull request #27 from teepark/stdin-encoding
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 |