G
Guest
i have a code that sends data to a socket listening over as400 platform,
the socket responds to me as a "byte array".
then i need to convert the "byte array" into a string.
the problem is that the data converted from the byte array into a string
, is not what i expect.
example:
- the data returned from the socket is (byte array)
"Usuario Sin Atribuciones Para Esta Función"
- the data obtained from the convert process is (a string)
"Usuario Sin Atribuciones Para Esta Funcisn"
look at the last word, it have an accent, but when i convert it, the accent
is loosed.
i am using then next code, in order to convert the byte array to string
-----------------------------------------------------------------------
string dataReceivedinText = Encoding.ASCII.GetString(bytesDataReceived);
-----------------------------------------------------------------------
what can i do, in order to solve my problem?
any suggestion?
many thanks
the socket responds to me as a "byte array".
then i need to convert the "byte array" into a string.
the problem is that the data converted from the byte array into a string
, is not what i expect.
example:
- the data returned from the socket is (byte array)
"Usuario Sin Atribuciones Para Esta Función"
- the data obtained from the convert process is (a string)
"Usuario Sin Atribuciones Para Esta Funcisn"
look at the last word, it have an accent, but when i convert it, the accent
is loosed.
i am using then next code, in order to convert the byte array to string
-----------------------------------------------------------------------
string dataReceivedinText = Encoding.ASCII.GetString(bytesDataReceived);
-----------------------------------------------------------------------
what can i do, in order to solve my problem?
any suggestion?
many thanks