62,046
社区成员
发帖
与我相关
我的任务
分享
byte[] byte_in = Encoding.UTF8.GetBytes("黄仕");
static string EncodeQuoted(byte[] str)
{
StringBuilder res = new StringBuilder();
for (int i = 0; i < str.Length; i++)
{
if (str[i] >= '!' && str[i] <= '~' && str[i] != '=')
{
res.Append(str[i]);
}
else
{
res.Append("=");
res.Append(((byte)str[i]).ToString("X"));
}
}
return res.ToString();
}