**See below comment** RTO is returning strange character encodings.
If I request something like dIBMd, I'm expecting to get encoded data from ts1 via Elektron.
Does anyone know how what I get back in the FIDs ROW64_1 (through 14) is encoded? I have an is this in UCS-2, UTF-16, UTF-8, etc?
I already understand how to decode ts1 data once it is in its binary form, but I need to get this into it first.
RECEIVED on dIBMd:
{
"PROD_PERM": 3063,
"RDNDISPLAY": 0,
"BOND_TYPE": " ",
"ROW64_1": " !????M$9\\+v???? <??????TC>????<??!??????7j m]??<J??1Th$????a6|(|????z(??C???? ??????\"??2g",
"ROW64_2": "??Jz,$?? 0!????p#????(Vn9???????:??D)???^??^p?? 9z2 &??)n????j????n??E??2??)?? ",
"ROW64_3": " ",
"ROW64_4": " ",
"ROW64_5": " ",
"ROW64_6": " ",
"ROW64_7": " ",
"ROW64_8": " ",
"ROW64_9": " ",
"ROW64_10": " M\"\"??+?? 6?:aj |??.,?? N]??",
"ROW64_11": "??L PZ_u_uv +??_w?????F??}~9??@??$??,?????.??n??[????L??6??d???????????{!?? ????Ur9'????7??",
"ROW64_12": "d????!??|3??6sP??5v???? ??I>%y_u??#q????v??_tQ3?????nA~!^;._tY????Ec??z??[????Z!K$?????????????",
"ROW64_13": ")9??F>??3????{??H??ow??????6V]S???????????T????%Wi<??????+??7????g???_uv??~????_p????????_t????????LN|??",
"ROW64_14": "?????yJ]??????????Bp????\"x??????E????????????%\"zVr??\"??Mx??l???????????1??????????)xD????i}B\"??&??|??????",
"RECORDTYPE": 237,
"REG_ID1": 0,
"REG_FIELD1": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
"ROW1_TIME": null,
"ROW2_TIME": null,
"ROW3_TIME": null,
"ROW4_TIME": null,
"ROW5_TIME": null,
"ROW6_TIME": null,
"ROW7_TIME": null,
"ROW8_TIME": null,
"ROW9_TIME": null,
"ROW10_TIME": null,
"ROW11_TIME": null,
"ROW12_TIME": null,
"ROW13_TIME": null,
"ROW14_TIME": null,
"BYTE_BMAP": 0,
"PREF_DISP": 0,
"DSO_ID": 0
}
I get the above using:
var readBuffer = new ArraySegment<byte>(new byte[Constants.BUFFER_SIZE]);
MemoryStream memoryStream = null;
byte[] dataBuffer;
while (true)
{
try
{
var result = await WebSocket.ReceiveAsync(readBuffer, Cts.Token);
if (!result.EndOfMessage)
{
if (memoryStream == null) memoryStream =
new MemoryStream(Constants.BUFFER_SIZE * 5);
memoryStream.Write(readBuffer.Array, readBuffer.Offset, readBuffer.Count);
readBuffer = new ArraySegment<byte>(new byte[Constants.BUFFER_SIZE]);
}
else
{
if (memoryStream != null)
{
memoryStream.Write(readBuffer.Array, readBuffer.Offset, readBuffer.Count);
dataBuffer = memoryStream.GetBuffer();
memoryStream.Dispose();
}
else
{
dataBuffer = readBuffer.Array;
}
break;
}
}
catch
{
cSpec.CloseSessions(this, null);
}
}
JArray messages = JArray.Parse(Encoding.ASCII.GetString(dataBuffer));