7

Does anyone know if there is a replacement in ASP.NET 5 for HttpResponse.ContentEncoding? https://msdn.microsoft.com/en-us/library/system.web.httpresponse.contentencoding(v=vs.110).aspx

koelkastfilosoof
  • 2,212
  • 1
  • 18
  • 28

2 Answers2

14

Example:

var mediaType = new MediaTypeHeaderValue("application/json");
mediaType.Encoding = Encoding.UTF8;
httpContext.Response.ContentType = mediaType.ToString();
Kiran
  • 56,921
  • 15
  • 176
  • 161
-2

Microsoft.Framework.WebEncoders.EncoderExtensions

have HtmlEncode, JavaScriptStringEncode and UrlEncode extensions

and the base Class is Microsoft.Framework.WebEncoders

John Davidson
  • 637
  • 5
  • 11