diff options
author | gbrandl <devnull@localhost> | 2006-10-31 23:46:24 +0100 |
---|---|---|
committer | gbrandl <devnull@localhost> | 2006-10-31 23:46:24 +0100 |
commit | 729df9d55ee975be89f18fa90964f19bead60feb (patch) | |
tree | 641a0511cbcfa260d1d4e2287f0ede38e50504d8 /pygments/formatter.py | |
parent | 026d59d92a7b574323484fae8a21c9bcc2401517 (diff) | |
download | pygments-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.py | 5 |
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=''): |