I have a CSV file that i need to rearrange and renecode. I’d like to run
line = line.decode('windows-1250').encode('utf-8')
on each line before it’s parsed and split by the CSV reader. Or I’d like iterate over lines myself run the re-encoding and use just single line parsing form CSV library but with the same reader instance.
Is there a way to do that nicely?
Thx, for the answers. The wrapping one gave me an idea:
That’s exactly what i was going for re-encoding a line just before it’s get parsed by the csv_reader.