From f76cbda8758b179aba69befc30e62476b47f2ba7 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 19 May 2013 11:53:14 +0200 Subject: Closes #852: let the formatters encoding to utf-8 if "guess" is given --- pygments/formatter.py | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit v1.2.1