-1
C#中JavaScript函数的等效函数是什么?
这里是我试图转换为C#的JavaScript语句:C# - UTF8⇔二进制,十六进制和Base 64转换器
utf82rstr = function (input) {
var output = "", i = 0, c = c1 = c2 = 0;
while (i < input.length) {
c = input.charCodeAt(i);
if (c < 128) {
output += String.fromCharCode(c);
i++;
} else if ((c > 191) && (c < 224)) {
c2 = input.charCodeAt(i + 1);
output += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
i += 2;
} else {
c2 = input.charCodeAt(i + 1);
c3 = input.charCodeAt(i + 2);
output += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
i += 3;
}
}
return output;
}
@RezaAghaei谢谢,但我编辑我的问题。所以,你的回答是不够的。 –