日期:2014-05-18  浏览次数:20898 次

string转UTF-8
如何将string字符串转换成utf-8的?
谢谢

------解决方案--------------------
C# code

using System.Text;

byte[] buffer = Encoding.GetEncoding("utf-8").GetBytes("中国");
string str = "";
foreach (byte b in buffer) str += string.Format("%{0:X}", b);