Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/332.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript C#-UTF8⇔;二进制、十六进制和基数64转换器_Javascript_C#_Utf 8_Hex_Converter - Fatal编程技术网

Javascript C#-UTF8⇔;二进制、十六进制和基数64转换器

Javascript C#-UTF8⇔;二进制、十六进制和基数64转换器,javascript,c#,utf-8,hex,converter,Javascript,C#,Utf 8,Hex,Converter,这个JavaScript函数在C#中的等价物是什么? 下面是我试图转换为C的JavaScript语句: utf82rstr=函数(输入){ var output=“”,i=0,c=c1=c2=0; while(i

这个JavaScript函数在C#中的等价物是什么?
下面是我试图转换为C的JavaScript语句:

utf82rstr=函数(输入){
var output=“”,i=0,c=c1=c2=0;
while(i191)和&(c<224)){
c2=输入字符编码(i+1);
output+=String.fromCharCode(((c&31)您可以使用或

以下是您在问题中提到的示例:

// returns س
var result = Char.ConvertFromUtf32(((216 & 31) << 6) | (179 & 63));
//返回س

var result=Char.ConvertFromUtf32(((216&31))我使用此函数并为我工作。我的解决方案:

静态字符串utf82rstr(字符串输入){
var输出=”;
int i=0,c=0,c2=0,c3=0;
while(i191)和&(c<224)){
c2=((int)输入[i+1]);

output+=Char.ConvertFromUtf32((c&31)@RezaAghaei谢谢,但是我编辑了我的问题。所以,你的答案是不够的。
//Both of rsult1 and result2 will be "A"
var result1 = Char.ConvertFromUtf32(int.Parse("0041", System.Globalization.NumberStyles.HexNumber));
var result2 = Char.Parse("\u0041").ToString();
// returns س
var result = Char.ConvertFromUtf32(((216 & 31) << 6) | (179 & 63));