Change output of REST to UTF8, which is what Terraria uses behind the scenes. Also changed content type to include the encoding. Fixes #858
This commit is contained in:
parent
3104e76d21
commit
f8a513d9da
1 changed files with 2 additions and 2 deletions
|
|
@ -155,9 +155,9 @@ namespace Rests
|
||||||
str = string.Format("{0}({1});", jsonp, str);
|
str = string.Format("{0}({1});", jsonp, str);
|
||||||
}
|
}
|
||||||
e.Response.Connection.Type = ConnectionType.Close;
|
e.Response.Connection.Type = ConnectionType.Close;
|
||||||
e.Response.ContentType = new ContentTypeHeader("application/json");
|
e.Response.ContentType = new ContentTypeHeader("application/json; charset=utf-8");
|
||||||
e.Response.Add(serverHeader);
|
e.Response.Add(serverHeader);
|
||||||
e.Response.Body.Write(Encoding.ASCII.GetBytes(str), 0, str.Length);
|
e.Response.Body.Write(Encoding.UTF8.GetBytes(str), 0, str.Length);
|
||||||
e.Response.Status = HttpStatusCode.OK;
|
e.Response.Status = HttpStatusCode.OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue