Convert from byte array to string
From: Ricardo Quintanilla (RicardoQuintanilla_at_discussions.microsoft.com)
Date: 11/04/04
- Next message: Stoitcho Goutsev \(100\) [C# MVP]: "Re: How to use a non static delegate in .NET Remoting ???"
- Previous message: Sam Martin: "Re: Sending SMS through C#"
- Next in thread: Nicholas Paldino [.NET/C# MVP]: "Re: Convert from byte array to string"
- Reply: Nicholas Paldino [.NET/C# MVP]: "Re: Convert from byte array to string"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 4 Nov 2004 06:04:06 -0800
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
-- Ricardo Quintanilla G.
- Next message: Stoitcho Goutsev \(100\) [C# MVP]: "Re: How to use a non static delegate in .NET Remoting ???"
- Previous message: Sam Martin: "Re: Sending SMS through C#"
- Next in thread: Nicholas Paldino [.NET/C# MVP]: "Re: Convert from byte array to string"
- Reply: Nicholas Paldino [.NET/C# MVP]: "Re: Convert from byte array to string"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|