Fixes for unicode handling in Python

This commit is contained in:
aothms
2015-09-13 14:43:42 +02:00
parent e5c20a009d
commit a58b2ede63
5 changed files with 9 additions and 5 deletions
@@ -82,6 +82,9 @@ class entity_instance(object):
attr_type = self.attribute_type(idx).title().replace(' ', '')
attr_type = attr_type.replace('Binary', 'String')
attr_type = attr_type.replace('Enumeration', 'String')
try:
if isinstance(value, unicode): value = value.encode("utf-8")
except: pass
getattr(self.wrapped_data, "setArgumentAs%s" % attr_type)(idx, entity_instance.unwrap_value(value))
return value
def __len__(self): return len(self.wrapped_data)