charmap codec cant encode characters in position xx - xx
Question: I am trying to use unicodecsv python library in python 2.7.x

    
    
    import codecs
    import unicodecsv
    
    def read(self, path):
        with codecs.open(path, "rb", encoding = "utf-8") as f:
            r = unicodecsv.reader(f, encoding = 'utf-8')    
            row = r.next()
            print row
    
    
    read("unicode.csv")
    

**Error:** charmap codec cant encode characters in position xx - xx

I have manually converted my csv file to utf-8 using txt editors so i am sure
the input file is fine


Answer: I see few problems with your code:

    
    
    def read(self, path):
    

You using `self` no within `class`

after opening file with `codecs.open`you can use standard python `csv` reader.

With some modifications:

    
    
    f = "/home/dzagorulkin/workspace/zont/file.txt"
    
    import codecs
    #import unicodecsv
    
    def read(path):
        with codecs.open(path, "rb", encoding = "utf-8") as f:            
            for line in f:
                print line
    read(f)
    

i used none ASCII file and output:

> Меня Дима зовут! Меня Дима зовут!

