Closed saulshanabrook closed 9 years ago
@saulshanabrook Ahhh yes, I've hit that one myself. I see you've got quite the Python/Django background, any ideas?
I've run into this during MIDAS development. I "solved" it by adding a function called "to_ascii" which would strip out non-ascii characters. It's messy and I'm not proud of it, but maybe it helps.
def to_ascii(s):
"""
Returns the ascii representation of a given string
"""
if type(s) == str:
try:
return s.encode("ascii", "replace")
except:
return None
elif type(s) == dict:
try:
temp_dict = {}
for k,v in s.iteritems():
temp_dict[k] = str(v).encode("ascii", "replace")
return temp_dict
except:
return None