diff options
Diffstat (limited to 'pygments/formatters/other.py')
-rw-r--r-- | pygments/formatters/other.py | 8 |
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', '') |