I'm using suds https://fedorahosted.org/suds/ to fetch data using SOAP. I'd like to cache the result (using memcached) to not overload the server from where I'm fetching the data. The problem is when fetching the cached data. Fetching it works fine but then django tries to decode the data (force_unicode) and it fails with the following:
The string that could not be encoded/decoded was: armv�rmare t
This is what I use to cache the result (where result = suds-object). Using cPickle (and tried pickle just in case but without success, no surprise).
The suds response is in unicode.
#Cache the result
cache.set(hashstring, pickle.dumps(result), 120)
#Return the cached data
result = cache.get(hashstring)
if result:
return pickle.loads(result, encoding='utf-8')