I encode string in c# using this code
System.Text.UTF8Encoding encoding=new System.Text.UTF8Encoding();
byte[] asciiBytes =encoding.GetBytes(result);
but I cant decode asciibytes to string can any one help me??
I encode string in c# using this code
System.Text.UTF8Encoding encoding=new System.Text.UTF8Encoding();
byte[] asciiBytes =encoding.GetBytes(result);
but I cant decode asciibytes to string can any one help me??
encoding.GetString(asciiBytes)
In some .NET versions this extension methode is not available so you have to use:
encoding.GetString(asciiBytes, 0, asciiBytes.Length)
Another note: ASCII and UTF-8 are not the same. So the wording asciiBytes is a bit confusing.
You can also use the static instance instead of creating an encoding
object.
Encoding.UTF8.GetBytes(..)
http://msdn.microsoft.com/en-us/library/744y86tc(v=vs.110).aspx