Ticket #10848 (new defect)

Opened 4 months ago

Last modified 1 day ago

Encode data as utf-8 during csv export

Reported by: anonymous Assigned to: rjollos
Priority: normal Component: TracHoursPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description (Last modified by rjollos)

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  
    10151015 
    10161016        for groupname, results in data['groups']: 
    10171017            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']]) 
    10201020            for result in results: 
    1021                 writer.writerow([unicode(result[header['name']]).encode('utf-8')  
     1021                writer.writerow([result[header['name']]  
    10221022                                 for header in data['headers']]) 
    10231023            writer.writerow([]) 

Attachments

trachours.patch (0.8 kB) - added by anonymous on 02/01/13 11:21:10.

Change History

02/01/13 11:21:10 changed by anonymous

  • attachment trachours.patch added.

05/20/13 10:37:54 changed by rjollos

  • description changed.

Add/Change #10848 (Encode data as utf-8 during csv export)




Change Properties
Action