Robust way to mitigate encode errors on /search resource?

12 views
Skip to first unread message

Shannon Burns

unread,
Jun 13, 2012, 2:07:36 PM6/13/12
to Otter API to Topsy, mack...@newmexicoconsortium.org
Hi,

I'm using the python wrapper to otter to run a search request, and I
successfully get a returned Resource object. However, occasionally I
get encode errors because of strange characters in some tweets. My
error looks like this:

" return codecs.charmap_encode(input,errors,encoding_table)
UnicodeEncodeError: 'charmap' codec can't encode character u'\x96' in
position 21: character maps to <undefined>"

It looks to me like the UnicodeEncodeError also truncates the Resource
that is returned.
Is there a robust way to request search resources that deals
automatically with encoding errors, or do I need to generate a home-
grown solution?

Thanks!
Reply all
Reply to author
Forward
0 new messages