diff options
author | gbrandl <devnull@localhost> | 2006-12-20 21:14:44 +0100 |
---|---|---|
committer | gbrandl <devnull@localhost> | 2006-12-20 21:14:44 +0100 |
commit | 1d634b6950bfac268f6d05a673fd48094738f01e (patch) | |
tree | 2788e9f4315a10392eee6371860c6045f8f74e31 /pygments/formatters/rtf.py | |
parent | 25ad3be9474211bb8a652deadea00677886dadf5 (diff) | |
download | pygments-1d634b6950bfac268f6d05a673fd48094738f01e.tar.gz |
[svn] Improve Unicode handling without encoding.
Diffstat (limited to 'pygments/formatters/rtf.py')
-rw-r--r-- | pygments/formatters/rtf.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pygments/formatters/rtf.py b/pygments/formatters/rtf.py index 4eaa929b..1aa0b9b8 100644 --- a/pygments/formatters/rtf.py +++ b/pygments/formatters/rtf.py @@ -18,6 +18,8 @@ __all__ = ['RtfFormatter'] class RtfFormatter(Formatter): """Output RTF (Rich Text Format).""" + unicodeoutput = False + def __init__(self, **options): """ Additional options accepted: @@ -67,6 +69,9 @@ class RtfFormatter(Formatter): return text.replace('\n', '\\par\n') def format(self, tokensource, outfile): + if not self.encoding: + outfile.write(u'') + outfile.write(r'{\rtf1\ansi\deff0' r'{\fonttbl{\f0\fmodern\fprq1\fcharset0%s;}}{\colortbl;' % (self.fontface and ' ' + self._escape(self.fontface) or '')) |