起因: AJAX异步通信到*.ashx一般处理程序时,传递中文将出现乱码。 解决方案一: 在aspx页面中的JS代码中进行编码: var fileName = "测试test"; fileName = escape(fileName); //传值编码,中文时有用 在一般程序程序页面(*.ashx) 解码: context.Response.ContentType = "text/plain"; //context.Response.Charset = "utf-8"; string name = HttpContext.Current.Server.UrlDecode(context.Request["name"]); //上传文件姓名,。解码 方案二 本地化 只在*.ashx页面加上以下代码: Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US"); Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US"); context.Response.ContentType = "text/plain";