Hi,
When I try to send a hexadecimal string via tcp from a client I have problems as the hextobytes function converts some negative values. When I convert this byte array to an int array and send it the values that appear on the server, some values that I don't quite understand. I would like the hex string that I send to appear on the server as it is. someone knows why it doesn't work for me.
when i send with charset utf8,ascii, i receive
the correct string i should receive is
What type of charset should I use to receive the string equal to the one I sent?
Thank you
When I try to send a hexadecimal string via tcp from a client I have problems as the hextobytes function converts some negative values. When I convert this byte array to an int array and send it the values that appear on the server, some values that I don't quite understand. I would like the hex string that I send to appear on the server as it is. someone knows why it doesn't work for me.
Hex array:
Dim Buffer() As Byte=Array As Byte(0x02,0x20,0x1A,0x31,0x31,0x31,0x32,0x33,0x5E,0x4C,0x10,-->0x83<---(correct byte),0x18,0x18,0x18,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x0A,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x0A,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x00-->,0xE5,0xF5<---,0x03)
astream.write(BytesToString(Buffer, 0, Buffer.Length, "UTF8"))
when i sendwith charset iso8859-1 i receive this{02}{20}{1A}{31}{31}{31}{32}{33}{5E}{4C}{10}-->{EF}{BF}{BD}<--{18}{18}{18}{20}{20}{20}{20}{20}{20}{20}{20}{20}{20}{20}{0A}{20}{20}{20}{20}{20}{20}{20}{20}{20}{20}{20}{0A}{20}{20}{20}{20}{20}{20}{20}{20}{20}{20}{20}{00}-->{EF}{BF}{BD}{EF}{BF}{BD}<----{03}
{02}{20}{1A}{31}{31}{31}{32}{33}{5E}{4C}{10}-->{C2}{83}<---{18}{18}{18}{20}{20}{20}{20}{20}{20}{20}{20}{20}{20}{20}{0A}{20}{20}{20}{20}{20}{20}{20}{20}{20}{20}{20}{0A}{20}{20}{20}{20}{20}{20}{20}{20}{20}{20}{20}{00}-->{C3}{A5}{C3}{B5}<---{03}]
the correct string i should receive is
{02}{20}{1A}{31}{31}{31}{32}{33}{5E}{4C}{10}-->{83}<--{18}{18}{18}{20}{20}{20}{20}{20}{20}{20}{20}{20}{20}{20}{0A}{20}{20}{20}{20}{20}{20}{20}{20}{20}{20}{20}{0A}{20}{20}{20}{20}{20}{20}{20}{20}{20}{20}{20}{00}-->{A5}{B5}<---{03}]
What type of charset should I use to receive the string equal to the one I sent?
Thank you
Last edited: