summaryrefslogtreecommitdiff
path: root/pygments/formatter.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-10-08 01:18:39 +0200
committerGeorg Brandl <georg@python.org>2014-10-08 01:18:39 +0200
commitc0ffb8a5babc8e6d1c58b92810f1cc11ae96ff85 (patch)
tree5a749b88bdba5d7c361c655febcdfc7f90cd9cf4 /pygments/formatter.py
parent2dd7a2b6b1aa538dc9fea6ca581a4657ccd7baf7 (diff)
downloadpygments-c0ffb8a5babc8e6d1c58b92810f1cc11ae96ff85.tar.gz
Closes #800: Add "inencoding" option to override "encoding".
Diffstat (limited to 'pygments/formatter.py')
-rw-r--r--pygments/formatter.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pygments/formatter.py b/pygments/formatter.py
index b16ffee8..86821383 100644
--- a/pygments/formatter.py
+++ b/pygments/formatter.py
@@ -68,10 +68,10 @@ 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
+ if self.encoding in ('guess', 'chardet'):
+ # can happen for e.g. pygmentize -O encoding=guess
self.encoding = 'utf-8'
- self.encoding = options.get('outencoding', None) or self.encoding
+ self.encoding = options.get('outencoding') or self.encoding
self.options = options
def get_style_defs(self, arg=''):