110,534
社区成员
发帖
与我相关
我的任务
分享
#region quoted-printable解码
private string QPUnEncryCode(string source)
{
source=source.Replace ("=\r\n","");
int len=source.Length ;
string dest=string.Empty ;
int i=0;
while(i<len)
{
string temp=source.Substring (i,1);
if(temp=="=")
{
int code=Convert.ToInt32 (source.Substring (i+1,2),16);
if(Convert.ToInt32 (code.ToString (),10)<127)
{
dest+=((char)code).ToString ();
i=i+3;
}
else
{
dest+=System.Text.Encoding.Default.GetString(new byte []{Convert.ToByte (source.Substring (i+1,2),16),Convert.ToByte (source.Substring (i+4,2),16)}) ;
i=i+6;
}
}
else
{
dest+=temp;
i++;
}
}
return dest;
}
#endregion