summaryrefslogtreecommitdiff
path: root/pygments/formatters/other.py
diff options
context:
space:
mode:
authorgbrandl <devnull@localhost>2006-12-20 21:14:44 +0100
committergbrandl <devnull@localhost>2006-12-20 21:14:44 +0100
commit1d634b6950bfac268f6d05a673fd48094738f01e (patch)
tree2788e9f4315a10392eee6371860c6045f8f74e31 /pygments/formatters/other.py
parent25ad3be9474211bb8a652deadea00677886dadf5 (diff)
downloadpygments-1d634b6950bfac268f6d05a673fd48094738f01e.tar.gz
[svn] Improve Unicode handling without encoding.
Diffstat (limited to 'pygments/formatters/other.py')
-rw-r--r--pygments/formatters/other.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/pygments/formatters/other.py b/pygments/formatters/other.py
index 4d6bd204..f6101848 100644
--- a/pygments/formatters/other.py
+++ b/pygments/formatters/other.py
@@ -20,8 +20,12 @@ class NullFormatter(Formatter):
Output the text unchanged without any formatting.
"""
def format(self, tokensource, outfile):
+ enc = self.encoding
for ttype, value in tokensource:
- outfile.write(value.encode(self.encoding))
+ if enc:
+ outfile.write(value.encode(enc))
+ else:
+ outfile.write(value)
class RawTokenFormatter(Formatter):
@@ -37,6 +41,8 @@ class RawTokenFormatter(Formatter):
the given compression algorithm (default: '').
"""
+ unicodeoutput = False
+
def __init__(self, **options):
Formatter.__init__(self, **options)
self.compress = options.get('compress', '')