Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将我选择的二进制值转换为相应的 UTF-16 字符值?我需要把它放到一个变量中,而不是一个文件中。
好吧,您可以利用已经存在多种编码的事实:
using System.Text; var str = Encoding.ASCII.GetString(new byte[] { 65, 66, 67 }); // "ABC" var chr = Encoding.ASCII.GetChars(new byte[] { 65 })[0]; // 'A'