Marshaling unicode WDDX

Tim Arnold tiarno at sas.com
Thu Jan 5 18:17:19 CET 2006


"isthar" <tkrzywicki at gmail.com> wrote in message 
news:1136480138.708572.210190 at g44g2000cwa.googlegroups.com...
> Hi !
> i am trying to serialise object which contains some unicode objects
> but looks like there is no way to do it.
>

hi, I'm sure you'll get better answers for the unicode part of your problem 
(I'd start with a look at the codecs module), but I wanted you to know that 
I'm using the wddx connection between Python and PHP with no problem. Here's 
the python code that writes a fairly complex data structure to the wddx 
file:

def writeDocReport(self):
        from xml.marshal import wddx
        fileName = '%s/%s.doc.wddx' % (os.path.join(adsWeb,'jobs','wddx'), 
self.name)
        tmpFile  = open(fileName,'wb')
        tmpFile.write(wddx.dumps(self.getDocData()))
        tmpFile.close()

and the PHP:

function getInputData($){
        $file = "wddx/$prodName.wddx";

        if (!is_file($file)) {
                exit("<h1>Report is not available for $prodName</h1>");
        }

        $output = wddx_deserialize(file_get_contents($file));





More information about the Python-list mailing list