diff options
author | Georg Brandl <georg@python.org> | 2014-01-09 20:28:57 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-01-09 20:28:57 +0100 |
commit | eda05a5bc7fac6f8bad252e0cf5ae37a4f918bd2 (patch) | |
tree | 36e90662c591bbaa9283749d191e7c052934b01c /pygments/lexer.py | |
parent | d2f5bd0e335d7ab8d6bee65cab8869a83624e2e3 (diff) | |
download | pygments-eda05a5bc7fac6f8bad252e0cf5ae37a4f918bd2.tar.gz |
Closes #851: remove BOM also with explicit encoding
Diffstat (limited to 'pygments/lexer.py')
-rw-r--r-- | pygments/lexer.py | 2 |
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'):] |