summaryrefslogtreecommitdiff
path: root/pygments/lexer.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/lexer.py')
-rw-r--r--pygments/lexer.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/pygments/lexer.py b/pygments/lexer.py
index ad2c72d1..6f466a77 100644
--- a/pygments/lexer.py
+++ b/pygments/lexer.py
@@ -164,6 +164,7 @@ class Lexer(object):
else:
text = text.decode(self.encoding)
# text now *is* a unicode string
+ text = text.lstrip(u'\xef\xbb\xbf\ufeff') # remove BOM
text = text.replace('\r\n', '\n')
text = text.replace('\r', '\n')
if self.stripall: