Share via


TextOutputFormatter.SelectCharacterEncoding Method

Definition

Determines the best Encoding amongst the supported encodings for reading or writing an HTTP entity body based on the provided content type.

public:
 virtual System::Text::Encoding ^ SelectCharacterEncoding(Microsoft::AspNetCore::Mvc::Formatters::OutputFormatterWriteContext ^ context);
public virtual System.Text.Encoding SelectCharacterEncoding (Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterWriteContext context);
abstract member SelectCharacterEncoding : Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterWriteContext -> System.Text.Encoding
override this.SelectCharacterEncoding : Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterWriteContext -> System.Text.Encoding
Public Overridable Function SelectCharacterEncoding (context As OutputFormatterWriteContext) As Encoding

Parameters

context
OutputFormatterWriteContext

The formatter context associated with the call.

Returns

The Encoding to use when reading the request or writing the response.

Applies to