summaryrefslogtreecommitdiff
path: root/pygments/lexer.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/lexer.py')
-rw-r--r--pygments/lexer.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/pygments/lexer.py b/pygments/lexer.py
index ad2c72d1..2280a250 100644
--- a/pygments/lexer.py
+++ b/pygments/lexer.py
@@ -163,6 +163,10 @@ class Lexer(object):
text = decoded
else:
text = text.decode(self.encoding)
+ else:
+ if text.startswith(u'\ufeff'):
+ text = text[len(u'\ufeff'):]
+
# text now *is* a unicode string
text = text.replace('\r\n', '\n')
text = text.replace('\r', '\n')