Here is my code (I am using python 2.7 )
result = " '{0}' is unicode or something: ".format(mongdb['field'])
UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in position 27: ordinal not in range(128)
It looks like a string I read from mongodb contains unicode. And it throws this error. How to fix it to concatenate this unicde with custom string 'is unicode or something:' ?
Thanks in advance
UPDATE
result = u" '{0}' is unicode or something: ".format(mongdb['field'])
works for me