Procházet zdrojové kódy

修复HttpComponent返回中文乱码的bug (#115)

ks před 7 roky
rodič
revize
553524edcd
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. 2 1
      Server/Model/Module/Http/HttpComponent.cs

+ 2 - 1
Server/Model/Module/Http/HttpComponent.cs

@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.IO;
 using System.Net;
 using System.Reflection;
+using System.Text;
 
 namespace ETModel
 {
@@ -242,7 +243,7 @@ namespace ETModel
 
 				if (result != null)
 				{
-					using (StreamWriter sw = new StreamWriter(context.Response.OutputStream))
+					using (StreamWriter sw = new StreamWriter(context.Response.OutputStream,Encoding.UTF8))
 					{
 						if (result.GetType() == typeof(string))
 						{