C# 解码NS记录的DNSrecord系统字节数组
我在将系统字节数组解码为字符串时遇到问题。当尝试对字节数组进行编码时,不管使用UTF-8还是ASCII编码,我最终得到一个四叶苜蓿作为其中一个字符。下面是我的伪代码片段:C# 解码NS记录的DNSrecord系统字节数组,c#,C#,我在将系统字节数组解码为字符串时遇到问题。当尝试对字节数组进行编码时,不管使用UTF-8还是ASCII编码,我最终得到一个四叶苜蓿作为其中一个字符。下面是我的伪代码片段: byte[] dnsrecord = {dnsRecord here} int count = dnsrecord.length - 27; //the actual DNS record states at index 27. string encodedstring = Encoding.UTF8.GetString(d
byte[] dnsrecord = {dnsRecord here} int count = dnsrecord.length - 27; //the actual DNS record states at index 27.
string encodedstring = Encoding.UTF8.GetString(dnsrecord,27,count);
DNS记录从索引27开始。然而,一旦进入域名,“.”就变成了四叶三叶草。它没有被正确解码。有没有人遇到过这个问题,或者知道我应该尝试什么其他编码