Marshaling unicode WDDX
"Martin v. Löwis"
martin at v.loewis.de
Thu Jan 5 20:44:55 CET 2006
> WDDX is perfect for me for exchange between python and php application.
> but maybe there is a better way to do it.
It appears that Unicode objects where forgotten in the WDDX
implementation. I suggest to define the following classes:
def m_unicode(self, data, dict):
return self.m_string(data.encode("utf-8"), dict)
def um_end_string(self, name):
ds = self.data_stack
ds[-1] = u"".join(ds[-1])
self.accumulating_chars = 0
The m_unicode part should get integrated into PyXML;
the um_end_string should probably return ASCII strings
if possible, else Unicode strings.
More information about the Python-list