while True:
    block = infile.read(BLOCKSIZE)
if not block:
    break
outfile.write(block.decode('latin1').encode('utf8'))
infile.close()
outfile.close()
Fastest way to convert file from latin1 to utf-8 in python