summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-01-09 20:28:57 +0100
committerGeorg Brandl <georg@python.org>2014-01-09 20:28:57 +0100
commiteda05a5bc7fac6f8bad252e0cf5ae37a4f918bd2 (patch)
tree36e90662c591bbaa9283749d191e7c052934b01c
parentd2f5bd0e335d7ab8d6bee65cab8869a83624e2e3 (diff)
downloadpygments-eda05a5bc7fac6f8bad252e0cf5ae37a4f918bd2.tar.gz
Closes #851: remove BOM also with explicit encoding
-rw-r--r--pygments/lexer.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/pygments/lexer.py b/pygments/lexer.py
index 8538fe7c..6f8e9c40 100644
--- a/pygments/lexer.py
+++ b/pygments/lexer.py
@@ -166,6 +166,8 @@ class Lexer(object):
text = decoded
else:
text = text.decode(self.encoding)
+ if text.startswith(u'\ufeff'):
+ text = text[len(u'\ufeff'):]
else:
if text.startswith(u'\ufeff'):
text = text[len(u'\ufeff'):]