我试图在C#和Node中 URLEncode 40个字节。
让我们以40字节为例:
signaturePad2.BackgroundImageView = new ImageView(Context)
{
Id = GenerateId(this),
LayoutParameters = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent)
};
signaturePad2.AddView(BackgroundImageView);
signaturePad2.BackgroundImage = MyGlobals.FileNameOfPhotoTaken;
让我们说我正在使用C#的 HttpUtility.UrlEncode(字节)
在C#中,我得到的内容如下:
86,63,228,90,223,138,78,142,224,198,114,68,205,42,206,252,233,190,184,160,199,64,124,176,104,189,106,187,103,105,141,45,16,210,219,189,63,56,150,150
在使用encodeURI()的nodejs中,我得到了这个:
V%3f%e4Z%df%8aN%8e%e0%c6rD%cd*%ce%fc%e9%be%b8%a0%c7%40%7c%b0h%bdj%bbgi%8d-%10%d2%db%bd%3f8%96%96
并且encodeURIComponent返回
encodeURI(new Buffer([86,63,228,90,223,138,78,142,224,198,114,68,205,42,206,252,233,190,184,160,199,64,124,176,104,189,106,187,103,105,141,45,16,210,219,189,63,56,150,150]))
=> 'V?%EF%BF%BDZ%DF%8AN%EF%BF%BD%EF%BF%BD%EF%BF%BDrD%EF%BF%BD*%EF%BF%BD%EF%BF%BD%E9%BE%B8%EF%BF%BD%EF%BF%BD@%7C%EF%BF%BDh%EF%BF%BDj%EF%BF%BDgi%EF%BF%BD-%60%EF%BF%BD%60Ua%00%EF%BF%BD%17'
我错过了什么吗?是否有URLEncode能够产生相同的C#编码输出?