diff options
author | Georg Brandl <georg@python.org> | 2013-01-09 12:26:50 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2013-01-09 12:26:50 +0100 |
commit | 68a10f38d3814e2292849306a815387c6259ce06 (patch) | |
tree | c4e686a0b5ef7f08f1bef6b33eedf0bc16d7f47f /pygments/lexer.py | |
parent | 2ca4dbd36a06c8f7d2d6f349f5921d558c138b19 (diff) | |
parent | e9e7db92d57ea2ab45b1094a48168b0d7e5a72a3 (diff) | |
download | pygments-68a10f38d3814e2292849306a815387c6259ce06.tar.gz |
Merged in gentoo90/pygments-main/nsis (pull request #136: Add NSIS script lexer)
Diffstat (limited to 'pygments/lexer.py')
-rw-r--r-- | pygments/lexer.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pygments/lexer.py b/pygments/lexer.py index ad2c72d1..7cb212d5 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') @@ -694,4 +698,3 @@ def do_insertions(insertions, tokens): except StopIteration: insleft = False break # not strictly necessary - |