diff options
author | Georg Brandl <georg@python.org> | 2014-09-20 12:11:53 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-09-20 12:11:53 +0200 |
commit | ccc25791eb7bd31d2c90ff52a747973615e087e2 (patch) | |
tree | 1693af68783b350096922919f52fe26f5b1ff9c2 /pygments/formatters/img.py | |
parent | 5f4ac79b49e93998ba827e0073ea2b0de95b6593 (diff) | |
download | pygments-ccc25791eb7bd31d2c90ff52a747973615e087e2.tar.gz |
Sort out Unicode output issues with RTF and image formatters.
Diffstat (limited to 'pygments/formatters/img.py')
-rw-r--r-- | pygments/formatters/img.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pygments/formatters/img.py b/pygments/formatters/img.py index 4f9fb1b0..db5bee3b 100644 --- a/pygments/formatters/img.py +++ b/pygments/formatters/img.py @@ -295,6 +295,7 @@ class ImageFormatter(Formatter): raise PilNotAvailable( 'Python Imaging Library is required for this formatter') Formatter.__init__(self, **options) + self.encoding = 'latin1' # let pygments.format() do the right thing # Read the style self.styles = dict(self.style) if self.style.background_color is None: @@ -478,8 +479,7 @@ class ImageFormatter(Formatter): draw = ImageDraw.Draw(im) recth = im.size[-1] rectw = self.image_pad + self.line_number_width - self.line_number_pad - draw.rectangle([(0, 0), - (rectw, recth)], + draw.rectangle([(0, 0), (rectw, recth)], fill=self.line_number_bg) draw.line([(rectw, 0), (rectw, recth)], fill=self.line_number_fg) del draw |