trying to parse csv file in python 3.4
Question: So I'm new in parsing csv files and I'm using the pycharm 4.5 IDE. I'm having
a problem parsing a csv file from crunchbase (the file I am dealing with is
pretty huge) and i get this UnicodeEndcodeError, I want to know why this is
happening.

(it's below to see the full error )

    
    
    return codecs.charmap_encode(input,self.errors,encoding_table[0])
    UnicodeEncodeError: 'charmap' codec can't encode characters in position 273-291:
    character maps to <undefined>
    

My code for parsing the csv file is below this line:

    
    
    import csv
    
    def parseCsvFile():
    #The code below reads csv file and puts each category in a list
     filename = input("Type file name: ")
     input_csv_file = csv.DictReader(open(filename, encoding="utf8"))
     for row in input_csv_file:
         print (row)
    
    csvfilename.close()
    

I didn't want to fully show my code on here because its a private project. I'm
not so desperate but lost why my output code appearing as it is. If anybody
has a better way to code, I am open to suggestions.


Answer: can you please let us know why you are using the utf8 encoding ??? do your
project specified that as one of the requirements ??? if it's not then you can
skip that option and it would solve your problem

