How can I convert data encoded in WE8MSWIN1252 to utf8 for use in Python scripts?
- by James Dean
This data comes from an Oracle database and is extracted to flatfiles in encoding 'WE8MSWIN1252'.
I want to parse the data and do some analysis. I want to see the text fields but do not need to publish the results to any other system so if some characters do not get converted perfectly I do not have a problem with that.
I just do not want my parsing to fail with a decode error which is what I get if I use:
inputFile = codecs.open( dataFileName, "r", "utf-8'")