[XML-SIG] Problem with wddx marshaller

Christian Scholz cs at comlounge.net
Tue Jun 24 15:20:54 EDT 2003


Hi!

> have a look to line 408 in $Python/_xmlplus/marshal/generic.py
> 
> and you'll find a nice comment (thanks to the kind developer for this !)
> which says:
> # might need to convert unicode string to byte string

Well, also detected it then ;-)

> So, the DS is actually UTF-8 and not iso-8859-1.

Also with utf-8 it wasn't working because it then uses str() on it.

> I would patch as follows (no test done, though):
> 
> def um_end_string(self, name):
>         ds = self.data_stack
>         # might need to convert unicode string to byte string
> 	  ds = ds.encode('iso-8859-1') # <-------------------------- patch to
> convert to iso-8859-1

Was also my thought to make it work with my specific application.
Though not the best one, I guess.

> 						 # Probably ds.encode(encoding) works as well, provided your
> encoding
> 						 # variable is set correctly

Yes, thought about this but wondered from where I get this variable.
Actually I never looked into the pyxml sources and thus am not so
familiar with it ;-)

I now fixed it as Fredrick suggested and removed the str(). If still
some error might come up I might use the fixed encoding stuff.

Thanks for the quick answers!

Christian




More information about the XML-SIG mailing list