summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgbrandl <devnull@localhost>2006-12-16 19:10:06 +0100
committergbrandl <devnull@localhost>2006-12-16 19:10:06 +0100
commit05d0e660cbb25c7a5335a12b53dff1de111c6d71 (patch)
treef70e139ca0a187f0b43bdd63fbe5455f42ba300b
parentef9a7df759fbd24f4728ff8a32e7ba9b3ac42157 (diff)
downloadpygments-05d0e660cbb25c7a5335a12b53dff1de111c6d71.tar.gz
[svn] Make RawTokenFormatter/Lexer use unicode escaped strings.
-rw-r--r--pygments/formatters/other.py2
-rw-r--r--pygments/lexers/special.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/pygments/formatters/other.py b/pygments/formatters/other.py
index 11e2566c..b3abe9da 100644
--- a/pygments/formatters/other.py
+++ b/pygments/formatters/other.py
@@ -62,7 +62,7 @@ class RawTokenFormatter(Formatter):
lasttype = None
lastval = u''
for ttype, value in tokensource:
- value = value.encode(self.encoding)
+ value = repr(value)
if ttype is lasttype:
lastval += value
else:
diff --git a/pygments/lexers/special.py b/pygments/lexers/special.py
index fb033647..28c382ab 100644
--- a/pygments/lexers/special.py
+++ b/pygments/lexers/special.py
@@ -78,6 +78,6 @@ class RawTokenLexer(Lexer):
for ttype_ in ttypes:
ttype = getattr(ttype, ttype_)
_ttype_cache[ttypestr] = ttype
- val = val[1:-2].decode('string-escape')
+ val = val[2:-2].decode('unicode-escape')
yield length, ttype, val
length += len(val)