summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)