如何让.net输出\uxxxx的unicode格式的字符
求救啊!!
<%@ WebHandler Language="C#" Class="Handler2" %>using System;using System.Web;public class Handler2 : IHttpHandler { public void ProcessRequest (HttpContext context) { context.Response.ContentType = "text/xml"; string s = "我"; string result=transfer(s); // u6211 context.Response.Write(result); } string transfer(string aa) { return "\u6211"; } public bool IsReusable { get { return false; } }}
char[] chs = s.ToCharArray(); string result = string.Empty; foreach (char c in chs) { result += char.ConvertToUtf32(c.ToString(), 0).ToString("x"); } return result;