Passing .NET strings containing " to Python.NET
Hello, We're using a socket connection to send information between a C++/C#-environment on one side to a Python/PythonDotNet environment on the other side. The information is packed in an XML string format. Packing and unpacking is done using the same C++/C#-code on both sides, thanks to PythonDotNet. When sending an XML string containing another XML string, any occurrences of " will cause the reminder of the string to be cut off. Replace any " with ? and the entire string is received. The curious thing is, this only happens when sending from C++/C# to the Python side. Sending the string the other way does not produce the same symptom. Ideas, anyone? Can the translation from a DotNet string to a Python string make this happen? Regards, Torleif
When sending an XML string containing another XML string, any occurrences of " will cause the reminder of the string to be cut off. Replace any " with ? and the entire string is received. The curious thing is, this only happens when sending from C++/C# to the Python side. Sending the string the other way does not produce the same symptom.
Ideas, anyone? Can the translation from a DotNet string to a Python string make this happen?
Hi Torleif, The translation of strings is based on .NET's idea of the length of the string, and shouldn't ever be affected by the content of the string one way or the other. This is a total guess, but I'd suspect that there is some subtle escaping problem at the application layer on one side or the other... Brian Lloyd brian@zope.com V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com
Hi, Thanks Brian, it turns out there are two different XML encoders/decoders doing their stuff, one in C++/MFC and the other in C#/DotNet. Decoding the XML on the DotNet side has been identified as the bug's nest. PythonDotNet is doing just fine on this. - Torleif ----- Original Message ----- From: "Brian Lloyd" <brian@zope.com> To: "Torleif Ringsaker" <torleif@tordivel.no>; <pythondotnet@python.org> Sent: Friday, December 03, 2004 4:52 PM Subject: RE: [Python.NET] Passing .NET strings containing " to Python.NET
When sending an XML string containing another XML string, any occurrences of " will cause the reminder of the string to be cut off. Replace any " with ? and the entire string is received. The curious thing is, this only happens when sending from C++/C# to the Python side. Sending the string the other way does not produce the same symptom.
Ideas, anyone? Can the translation from a DotNet string to a Python string make this happen?
Hi Torleif,
The translation of strings is based on .NET's idea of the length of the string, and shouldn't ever be affected by the content of the string one way or the other.
This is a total guess, but I'd suspect that there is some subtle escaping problem at the application layer on one side or the other...
Brian Lloyd brian@zope.com V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com
participants (2)
-
Brian Lloyd -
Torleif Ringsaker