1,146
社区成员
发帖
与我相关
我的任务
分享
public string Encode(string str)
{
try
{
byte[] bytes = Encoding.GetEncoding("utf-8").GetBytes(str);
string result = "=?UTF-8?B?" + Convert.ToBase64String(bytes) + "?=";
return result;
}
catch (Exception ex)//(UnsupportedEncodingException ex)
{
return null;
}
}