byte[] test = new byte[16];
new Random().NextBytes(test);
Console.WriteLine(System.Text.Encoding.UTF8.GetString(test, 0, 16));
我已经试过所有的编码了 UTF8/7Default、gb2···等等等等···都是乱码 为什么?
...全文
1982打赏收藏
Random().NextBytes() 后的数组 为什么转为string 会 乱码 急急急!
byte[] test = new byte[16]; new Random().NextBytes(test); Console.WriteLine(System.Text.Encoding.UTF8.GetString(test, 0, 16)); 我已经试过所有的编码了 UTF8/7Default、gb2···等等等等···都是乱码 为什么?