DictWriter with wrong encoding
===

I've looked all around the net but I can't seem to get this thing to work.

I'm using **python2.6** to read a csv file **input.csv** and want to output it line-for-line into **output.csv** using **DictReader** and **DictWriter** in python. 

I know nothing about the encoding of **input.csv**.
Everything is fine to the EYES when I open **output.csv** but when I run a **diff** command on the two lines, *EVERY LINE IS DIFFERENT*. I need the byte sequence of the files to be the same because I'm submitting the file as an assignment.

Here is the bare bone of the code I have (borrowed from here and there):

    from csv import DictReader,DictWriter
    
    class DictWriterEx(DictWriter):
        def writeheader(self):
            header = dict(zip(self.fieldnames, self.fieldnames))
            self.writerow(header)
            
    with open('infect.csv','r',) as f:
        dr = DictReader(f)
        with open('myinfect.csv','w') as o:
            dw = DictWriterEx(o,fieldnames=dr.fieldnames)
            dw.writeheader()
            for row in dr:
                dw.writerow(dict((k, v) for k, v in row.iteritems()))


I've also tried changing the

    dw.writerow(dict((k, v) for k, v in row.iteritems()))

line into

    dw.writerow(dict((k, v) for k, v in row.iteritems()))

which gives me the exception:

> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 7: ordinal not in range(128)

Please help me solve this issue because I am going crazy.
