byte[] buffer = Encoding.GetEncoding("utf-8").GetBytes("美丽");
string strbyte = "";foreach (byte b in buffer)
strbyte += string.Format("%{0:X}", b);上面的代码是把中文"美丽"转换成了十六进制.问:如何把十六进制转换成"美丽"呢?
string strbyte = "";foreach (byte b in buffer)
strbyte += string.Format("%{0:X}", b);上面的代码是把中文"美丽"转换成了十六进制.问:如何把十六进制转换成"美丽"呢?
string test = "%E7%BE%8E%E4%B8%BD";
string result = System.Web.HttpUtility.UrlDecode(test, Encoding.UTF8); //美丽
Server.UrlDecode