aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2011-06-27 08:50:14 -0700
committerWaylan Limberg <waylan@gmail.com>2011-06-27 08:50:14 -0700
commit9b26d2b5e567f0c18ed9ef88ee4f3d82bb4092cf (patch)
treeda73ab11296231af0f3dc79750e50460590d9b47
parent4f11e375ad775d562b24482e22b7aa8d3a4ac936 (diff)
parent50eb66d6d1796a10726c013191cdf95638419f0f (diff)
downloadmarkdown-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__.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