开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜