From a330fed217158719c6eb7d36d8ae16e0bb96740d Mon Sep 17 00:00:00 2001 From: j502647092 Date: Mon, 10 Aug 2015 00:07:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=95=B0=E6=8D=AE=E8=B0=83=E8=AF=95=E5=AE=8C?= =?UTF-8?q?=E6=88=90=20=E6=8F=90=E4=BA=A4=E6=9B=B4=E6=96=B0...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Authentication/CTZAuthenticator.cs | 3 +- CTZLauncher/HttpHelper.cs | 2 +- CTZLauncher/MainWindow.xaml | 44 +++++++++---------- CTZLauncher/MainWindow.xaml.cs | 13 ++---- 4 files changed, 29 insertions(+), 33 deletions(-) diff --git a/CTZLauncher/Authentication/CTZAuthenticator.cs b/CTZLauncher/Authentication/CTZAuthenticator.cs index 831e86c..c93c7e0 100644 --- a/CTZLauncher/Authentication/CTZAuthenticator.cs +++ b/CTZLauncher/Authentication/CTZAuthenticator.cs @@ -68,7 +68,8 @@ namespace KMCCC.Authentication public string getServerList() { - return http.Send(HttpMethod.GET, Address + ":" + Port + "/serverlist"); + string sl = http.Send(HttpMethod.GET, Address + ":" + Port + "/serverlist"); + return sl.Replace("\0",""); } public bool getResult(string url) diff --git a/CTZLauncher/HttpHelper.cs b/CTZLauncher/HttpHelper.cs index b91bc06..8ab0c22 100644 --- a/CTZLauncher/HttpHelper.cs +++ b/CTZLauncher/HttpHelper.cs @@ -206,7 +206,7 @@ namespace CityCraft private string ParseResponse(byte[] responseBytes) { - string responseStr = Encoding.UTF8.GetString(responseBytes); + string responseStr = Encoding.Default.GetString(responseBytes); int splitindex = responseStr.IndexOf("\r\n\r\n"); if (splitindex > 0) { diff --git a/CTZLauncher/MainWindow.xaml b/CTZLauncher/MainWindow.xaml index a524838..7360dc3 100644 --- a/CTZLauncher/MainWindow.xaml +++ b/CTZLauncher/MainWindow.xaml @@ -57,7 +57,7 @@