summaryrefslogtreecommitdiff
path: root/pygments/formatter.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2013-05-19 11:53:14 +0200
committerGeorg Brandl <georg@python.org>2013-05-19 11:53:14 +0200
commitf76cbda8758b179aba69befc30e62476b47f2ba7 (patch)
tree6867a864f6968842d3348d808c0c36af70556a63 /pygments/formatter.py
parentba543fa966243c4bdc316373ecd7b4f047ff1192 (diff)
downloadpygments-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.py3
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