Modify ↓
Opened 12 years ago
Closed 12 years ago
#10848 closed defect (duplicate)
Encode data as utf-8 during csv export
Reported by: | anonymous | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Component: | TracHoursPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: |
Description (last modified by )
If the database utf-8 encoded data is used it cannot be exported as the csvwriter will convert to ascii automatically.
Below is a small fix to solve the problem:
-
hours.py
old new 1015 1015 1016 1016 for groupname, results in data['groups']: 1017 1017 if groupname: 1018 writer.writerow( unicode(groupname).encode('utf-8'))1019 writer.writerow([ unicode(header['label']).encode('utf-8')for header in data['headers']])1018 writer.writerow(groupname) 1019 writer.writerow([header['label'] for header in data['headers']]) 1020 1020 for result in results: 1021 writer.writerow([ unicode(result[header['name']]).encode('utf-8')1021 writer.writerow([result[header['name']] 1022 1022 for header in data['headers']]) 1023 1023 writer.writerow([])
Attachments (1)
Change History (4)
Changed 12 years ago by
Attachment: | trachours.patch added |
---|
comment:1 Changed 12 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 12 years ago by
Status: | new → assigned |
---|
comment:3 Changed 12 years ago by
Resolution: | → duplicate |
---|---|
Status: | assigned → closed |
Duplicate of #10233.
Note: See
TracTickets for help on using
tickets.
It looks like the patch is backwards, but otherwise looks good.