Commits

Georg Brandl committed 470fd52

Closes #852: let the formatters encoding to utf-8 if "guess" is given

Comments (0)

Files changed (1)

pygments/formatter.py

         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