gbrandl  committed 5f1818b

[svn] Clarify docs and remove debugging code.

  • Participants
  • Parent commits 7146fa9
  • Branches trunk

Comments (0)

Files changed (2)

File docs/src/formatters.txt

     If this is ``""`` or ``None``, Unicode strings will be written
     to the output file, which most file-like objects do not support.
+    For example, `pygments.highlight()` will return a Unicode string if
+    called with no `outfile` argument and a formatter that has `encoding`
+    set to ``None`` because it uses a `StringIO.StringIO` object that
+    supports Unicode arguments to `write()`. Using a regular file object
+    wouldn't work.
 The `HtmlFormatter` and `LatexFormatter` classes support these options:

File pygments/formatters/

         return text.replace('\n', '\\par\n')
     def format(self, tokensource, outfile):
-        if not self.encoding:
-            outfile.write(u'')
                       r'{\fonttbl{\f0\fmodern\fprq1\fcharset0%s;}}{\colortbl;' %
                       (self.fontface and ' ' + self._escape(self.fontface) or ''))