AI智能
改变未来

C# 转编码

 

//GB2312或ASCII转UTF8

public static string getUtf8(string param)
{
byte[] buffers = Encoding.GetEncoding(\”GB2312\”).GetBytes(param);
param = Encoding.UTF8.GetString(buffers);
//param = Encoding.UTF8.GetString(Encoding.ASCII.GetBytes(param));
return param;
}

 

赞(0) 打赏
未经允许不得转载:爱站程序员基地 » C# 转编码