diff options
author | gbrandl <devnull@localhost> | 2006-12-20 21:14:44 +0100 |
---|---|---|
committer | gbrandl <devnull@localhost> | 2006-12-20 21:14:44 +0100 |
commit | 1d634b6950bfac268f6d05a673fd48094738f01e (patch) | |
tree | 2788e9f4315a10392eee6371860c6045f8f74e31 /pygments/formatters/bbcode.py | |
parent | 25ad3be9474211bb8a652deadea00677886dadf5 (diff) | |
download | pygments-1d634b6950bfac268f6d05a673fd48094738f01e.tar.gz |
[svn] Improve Unicode handling without encoding.
Diffstat (limited to 'pygments/formatters/bbcode.py')
-rw-r--r-- | pygments/formatters/bbcode.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pygments/formatters/bbcode.py b/pygments/formatters/bbcode.py index 0e9338bd..d9b96485 100644 --- a/pygments/formatters/bbcode.py +++ b/pygments/formatters/bbcode.py @@ -72,11 +72,13 @@ class BBCodeFormatter(Formatter): if self._mono: outfile.write('[font=monospace]') + enc = self.encoding lastval = '' lasttype = None for ttype, value in tokensource: - value = value.encode(self.encoding) + if enc: + value = value.encode(enc) while ttype not in self.styles: ttype = ttype.parent if ttype == lasttype: |