Skip to content

Commit

Permalink
Merge pull request #343 from OmniSharp/fix/340
Browse files Browse the repository at this point in the history
Fixes #338 / #340
  • Loading branch information
willl committed Nov 23, 2015
2 parents 12a1e97 + a453366 commit 54eeb15
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/OmniSharp/Middleware/EndpointMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http;
Expand Down Expand Up @@ -100,10 +101,17 @@ public async Task Invoke(HttpContext httpContext)

await _next(httpContext);
}

#if DNXCORE50
private static readonly Encoding _encoding = System.Text.Encoding.GetEncoding(1252);
#else
private static readonly Encoding _encoding = System.Text.Encoding.Default;
#endif


private void SerializeResponseObject(HttpResponse response, object value)
{
using (var writer = new StreamWriter(response.Body, System.Text.Encoding.UTF8, 1024, true))
using (var writer = new StreamWriter(response.Body, _encoding, 1024, true))
using (var jsonWriter = new JsonTextWriter(writer))
{
jsonWriter.CloseOutput = false;
Expand Down

0 comments on commit 54eeb15

Please sign in to comment.