日期:2014-05-18 浏览次数:20947 次
string test = "中华人民共和国"; StringBuilder sb = new StringBuilder(); foreach (char c in test) { sb.Append(string.Format("%u{0:X2}", (short)c)); } Console.WriteLine(sb.ToString());
------解决方案--------------------
要先搞清楚那一段是哪種編碼
------解决方案--------------------
public string EncodeBase6(string code_type,string code) { string encode = ""; byte[] bytes = Encoding.GetEncoding(code_type).GetBytes(code); try { encode = Convert.ToBase6String(bytes); } catch { encode = code; } return encode; } //base64的拿去参考一下
------解决方案--------------------
//解码 string str = "%u591A%u591A%u5173%u7167%u591A%u591A%u5173%u7167"; Response.Write(Server.UrlDecode(str));//输入结果:多多关照多多关照