heh
you stuff 16 bit values in and try to convert using utf32 ???
the data is UTF16 not UTF32
Dim mb As New Xojo.Core.MutableMemoryBlock(4)
mb.UInt16Value(0) = 34 // you stuff 16 bit values in here
mb.UInt16Value(2) = 66
Dim xml As New XmlDocument
Dim RootNode As XmlNode
RootNode = xml.AppendChild(xml.CreateElement("Data"))
Dim t As Text = Xojo.Core.TextEncoding.UTF16LittleEndian.ConvertDataToText(mb) // <<<< :P not UTF32
RootNode.AppendChild(xml.CreateTextNode(t)) //Error
System.DebugLog xml.ToString
I made the poor assumption that I could just stuff the memory block with data (UInt16’s) and then convert it with a UInt32 (because its 2 x 16 bit)… A poor decision on my part
@Eugene Dakin
Convert data which your transporting to base64 or HEX kind of data and then put it in XML node. On 2nd end, just decode it and make of it mb.
TIP:
Do a testing of encoding/decoding with base64 since on some supported dev. platforms Xojo doesn’t handle it well.
HEX encoding is also okay but it’s bigger in data size for transporting.