summaryrefslogtreecommitdiff
path: root/pygments/formatters/other.py
diff options
context:
space:
mode:
authorgbrandl <devnull@localhost>2006-10-31 23:46:24 +0100
committergbrandl <devnull@localhost>2006-10-31 23:46:24 +0100
commit729df9d55ee975be89f18fa90964f19bead60feb (patch)
tree641a0511cbcfa260d1d4e2287f0ede38e50504d8 /pygments/formatters/other.py
parent026d59d92a7b574323484fae8a21c9bcc2401517 (diff)
downloadpygments-729df9d55ee975be89f18fa90964f19bead60feb.tar.gz
[svn] Add encoding support. All processing is now done with unicode strings.
Diffstat (limited to 'pygments/formatters/other.py')
-rw-r--r--pygments/formatters/other.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pygments/formatters/other.py b/pygments/formatters/other.py
index a3657bbb..affbbfc2 100644
--- a/pygments/formatters/other.py
+++ b/pygments/formatters/other.py
@@ -21,7 +21,7 @@ class NullFormatter(Formatter):
"""
def format(self, tokensource, outfile):
for ttype, value in tokensource:
- outfile.write(value)
+ outfile.write(value.encode(self.encoding))
class RawTokenFormatter(Formatter):
@@ -60,8 +60,9 @@ class RawTokenFormatter(Formatter):
flush = outfile.flush
lasttype = None
- lastval = ''
+ lastval = u''
for ttype, value in tokensource:
+ value = value.encode(self.encoding)
if ttype is lasttype:
lastval += value
else: