summaryrefslogtreecommitdiff
path: root/pygments/formatter.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/formatter.py
parent026d59d92a7b574323484fae8a21c9bcc2401517 (diff)
downloadpygments-729df9d55ee975be89f18fa90964f19bead60feb.tar.gz
[svn] Add encoding support. All processing is now done with unicode strings.
Diffstat (limited to 'pygments/formatter.py')
-rw-r--r--pygments/formatter.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pygments/formatter.py b/pygments/formatter.py
index d6b48475..4082150b 100644
--- a/pygments/formatter.py
+++ b/pygments/formatter.py
@@ -38,12 +38,17 @@ class Formatter(object):
``title``
If ``full`` is true, the title that should be used to
caption the document (default: '').
+ ``encoding``
+ If given, must be an encoding name. This will be used to
+ convert the Unicode token strings to byte strings in the
+ output (default: 'latin1').
"""
def __init__(self, **options):
self.style = _lookup_style(options.get('style', 'default'))
self.full = get_bool_opt(options, 'full', False)
self.title = options.get('title', '')
+ self.encoding = options.get('encoding', 'latin1')
self.options = options
def get_style_defs(self, arg=''):