Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/235.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/35.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
来自PHP和.net的等效代码给出不同的返回_Php_Asp.net_Vb.net - Fatal编程技术网

来自PHP和.net的等效代码给出不同的返回

来自PHP和.net的等效代码给出不同的返回,php,asp.net,vb.net,Php,Asp.net,Vb.net,我有两个函数应该返回相同的值。这些函数用于解码基64中的文本 PHP代码 $kc = 'sq7HjrUOBfKmC576ILgskD5srU870gJ7'; function decodeBase64($data){ $data = base64_decode($data); return $data; } vb.net中的代码 Dim kc As String = "sq7HjrUOBfKmC576ILgskD5srU870gJ7" Function DecodeBase64

我有两个函数应该返回相同的值。这些函数用于解码基64中的文本

PHP代码

$kc = 'sq7HjrUOBfKmC576ILgskD5srU870gJ7';
function decodeBase64($data){
    $data = base64_decode($data);
    return $data;
}
vb.net中的代码

Dim kc As String = "sq7HjrUOBfKmC576ILgskD5srU870gJ7"
Function DecodeBase64(data As String) As String
    Dim decodedBytes() As Byte = Convert.FromBase64String(data)
    Return Encoding.UTF8.GetString(decodedBytes)
End Function
PHP的返回是

��ǎ�\u000e\u0005�\u000b�� �,�>l�O;�\u0002{
NEt的回归是

��ǎ���� �,�>l�O;�{

PHP代码是正确的。有谁能告诉我.Net等效代码有什么问题吗?

我想这与字符编码有关。原始字节是相同的。它们只是以不同的方式显示。你能给我们看一下这些函数(特别是PHP函数)的完整代码吗?我猜这与字符编码有关。原始字节是相同的。它们只是以不同的方式显示。您能向我们展示这些函数的完整代码(特别是PHP函数)吗?