managed mbcs to wide
I have a byte array of MBCS characters to convert to Unicode wide characters. Any help? This doesn't work.
var encoder = new UnicodeEncoding();
while (true)
{
int bytesRead = fstream.Read(buffer, 0, BUFFER_SIZE);
开发者_如何学JAVA
//could not read from file stream
if (bytesRead == 0)
break;
Console.Write(encoder.GetString(buffer, 0, bytesRead));
}
You should be able to use Encoding.Convert(srcEncoding, dstEncoding, ...) to do this.
精彩评论