Skip to content Skip to sidebar Skip to footer

Python: Unicodedecodeerror: 'utf8' Codec Can't Decode Byte 0x91

I'm parsing a CSV as follows: with open(args.csv, 'rU') as csvfile: try: reader = csv.DictReader(csvfile, dialect=csv.QUOTE_NONE) for row in reader:

Solution 1:

Byte 0x91 is a "smart" opening single quote in Windows-1252 encoding. So it sounds like that's the encoding your file is using, not UTF-8. So, use open(args.csv, 'rU', encoding='windows-1252').


Post a Comment for "Python: Unicodedecodeerror: 'utf8' Codec Can't Decode Byte 0x91"