django - python german umlaut issues - 'ascii' codec can't decode byte 0xe4 in position 15: ordinal not in range(128) -


i reading csv file , saving data model.

with open(settings.media_root + '\\f.csv', 'rb') f:     reader = csv.reader(f,delimiter=';')     row in reader:         uname =  u"'" + row[2]+"'".encode('utf-8')         u = university(name=uname)         u.save() 

and have word in file: westfälisch. word code gets stuck.

this error message:

'ascii' codec can't decode byte 0xe4 in position 15: ordinal not in range(128)  string not encoded/decoded was: westf�lisch 

what doing wrong? please help.

uname =  ("'" + row[2]+"'").decode('utf-8') # need 

Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -