In C# How can we convert byte[] to string with a charset.eg utf8,SHIFT_JIS,and more
.I know Encoding.UTF8
byte[] inputBytes =SupportClass.ToByteArray(readBytes);
StringBuilder result;
result.Append(System.Text.Encoding.UTF8.GetString(inputBytes,0,inputBytes.Length));//get unreadable code.
my question is how can I get the result from inputBytes with a special charset,like java
StringBuffer result.append(new String(buffer, "SJIS"));
See this article:
http://msdn.microsoft.com/en-us/library/aa332097(v=vs.71).aspx