From: Fredrik Tolf Date: Sun, 13 May 2012 02:12:25 +0000 (+0200) Subject: Backported indent-encoding fix. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=ee213a9b2c572b9abca9a1babb5c32c9512f0682;p=wrw.git Backported indent-encoding fix. --- diff --git a/wrw/sp/util.py b/wrw/sp/util.py index 96e9880..f387f1c 100644 --- a/wrw/sp/util.py +++ b/wrw/sp/util.py @@ -183,18 +183,21 @@ class indenter(formatter): reind = False if not self.simple(el): sub = self.update(curind=self.curind + self.indent) - sub.out.indent(sub.curind) + sub.reindent() reind = True for ch in el.children: sub.node(ch) if reind: - self.out.indent(self.curind) + self.reindent() self.endtag(el) def element(self, el, **extra): super(indenter, self).element(el, **extra) if self.out.col > 80 and self.simple(el): - self.out.indent(self.curind) + self.reindent() + + def reindent(self): + self.out.indent(self.curind.encode(self.charset)) def start(self): super(indenter, self).start()