Make sure to write the correct number of bytes, as UTF8 can and most likely will be more than one byte per char.
Fixes #863
This commit is contained in:
parent
d82851faf3
commit
68afd6fcc6
1 changed files with 2 additions and 1 deletions
|
|
@ -157,7 +157,8 @@ namespace Rests
|
|||
e.Response.Connection.Type = ConnectionType.Close;
|
||||
e.Response.ContentType = new ContentTypeHeader("application/json; charset=utf-8");
|
||||
e.Response.Add(serverHeader);
|
||||
e.Response.Body.Write(Encoding.UTF8.GetBytes(str), 0, str.Length);
|
||||
var bytes = Encoding.UTF8.GetBytes(str);
|
||||
e.Response.Body.Write(bytes, 0, bytes.Length);
|
||||
e.Response.Status = HttpStatusCode.OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue