textwrap garbles utf8 messages.

Bug #1078974 reported by KURASHIKI Satoru
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
editmoin
New
Undecided
Unassigned

Bug Description

hi,

editmoin gets server replies, and modify it to generate header area.
I get garbled header lines when I use moin with Japanese (it uses utf-8, but editmoin assumes ascii only?).

Workaround below:

        if self.status is not None:
- text = self.status.replace(EXTENDMSG, "").strip()
+ text = self.status.decode('utf-8').replace(EXTENDMSG, "").strip()
            lines = textwrap.wrap(text, 70,
                                  initial_indent="@@ Message: ",
                                  subsequent_indent="@ ")
            for line in lines:
- file.write(line+"\n")
+ file.write(line.encode('utf-8')+"\n")

regards,

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.