PB5.30 CatchXML() failed in unicode mode
Posted: Thu Sep 11, 2014 9:51 am
Hi,
when i receive a string over network and want to parse it, i hand it over to the CatchXML() method for further processing. That works well if "Create unicode executable" is off. With unicode on, it fails.
Here is a sample code to test:
As you can see, the reason is, that the CatchXML() method does not consider that the raw string data is twice the length of the string. If we double the length, it works.
I think, this must be fully handled by the CatchXML() method.
Best regards
Uwe
when i receive a string over network and want to parse it, i hand it over to the CatchXML() method for further processing. That works well if "Create unicode executable" is off. With unicode on, it fails.
Here is a sample code to test:
Code: Select all
xml.s = "<item></item>"
;fails if "Create unicode executables" is TRUE
CatchXML(0, @xml, Len(xml))
If XMLStatus(0) = #PB_XML_Success
Debug "SUCCESS"
Else
Debug "FAILED"
EndIf
;if we double the string length, it works
CatchXML(0, @xml, Len(xml) * 2)
If XMLStatus(0) = #PB_XML_Success
Debug "SUCCESS"
Else
Debug "FAILED"
EndIf
I think, this must be fully handled by the CatchXML() method.
Best regards
Uwe