更新时间:2023-02-07 19:57:39
等效的C#取决于您的缓冲区是什么.如果它已经是类似于string Buffer = "<bunch of characters>";
的字符串,则无需执行任何操作.它已经是一个unicode字符串.如果是字节数组,请使用System.Text.Encoding
中的一种编码器> [ ^ ]和呼叫GetString(buffer)
[Convert()
[
The equivalent C# depends a bit on what your buffer is. If it''s already a string like yourstring Buffer = "<bunch of characters>";
, you don''t have to do anything. It is already a unicode string. If it''s a byte array, use one of the encoders inSystem.Text.Encoding
[^] and callGetString(buffer)
[^]. You can also callConvert()
[^] first if you know the bytes are not in the encoding you need.
I''m not sure what you mean by "normal text". The string you show is as good as you are going to get due to the unprintable characters it contains.