Replacement for HttpResponse.ContentEncoding ASP.NET 5
Asked Answered
T

2

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

Telemark answered 9/7, 2015 at 14:19 Comment(0)
T
15

Example:

var mediaType = new MediaTypeHeaderValue("application/json");
mediaType.Encoding = Encoding.UTF8;
httpContext.Response.ContentType = mediaType.ToString();
Tokharian answered 9/7, 2015 at 16:11 Comment(0)
M
-2

Microsoft.Framework.WebEncoders.EncoderExtensions

have HtmlEncode, JavaScriptStringEncode and UrlEncode extensions

and the base Class is Microsoft.Framework.WebEncoders

Maura answered 9/7, 2015 at 15:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.