Unicode error

dirknbr dirknbr at gmail.com
Fri Jul 23 06:14:11 EDT 2010


I am having some problems with unicode from json.

This is the error I get

UnicodeEncodeError: 'ascii' codec can't encode character u'\x93' in
position 61: ordinal not in range(128)

I have kind of developped this but obviously it's not nice, any better
ideas?

        try:
            text=texts[i]
            text=text.encode('latin-1')
            text=text.encode('utf-8')
        except:
            text=' '

Dirk



More information about the Python-list mailing list