diff options
author | Georg Brandl <georg@python.org> | 2013-05-19 11:53:14 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2013-05-19 11:53:14 +0200 |
commit | f76cbda8758b179aba69befc30e62476b47f2ba7 (patch) | |
tree | 6867a864f6968842d3348d808c0c36af70556a63 /pygments/formatter.py | |
parent | ba543fa966243c4bdc316373ecd7b4f047ff1192 (diff) | |
download | pygments-f76cbda8758b179aba69befc30e62476b47f2ba7.tar.gz |
Closes #852: let the formatters encoding to utf-8 if "guess" is given
Diffstat (limited to 'pygments/formatter.py')
-rw-r--r-- | pygments/formatter.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pygments/formatter.py b/pygments/formatter.py index 4b69f2a4..c1d6f2e1 100644 --- a/pygments/formatter.py +++ b/pygments/formatter.py @@ -68,6 +68,9 @@ class Formatter(object): self.full = get_bool_opt(options, 'full', False) self.title = options.get('title', '') self.encoding = options.get('encoding', None) or None + if self.encoding == 'guess': + # can happen for pygmentize -O encoding=guess + self.encoding = 'utf-8' self.encoding = options.get('outencoding', None) or self.encoding self.options = options |