次の方法で共有


MediaTypeFormatter.SelectCharacterEncoding Method

Determines the best character encoding for reading or writing an HTTP entity body, given a set of content headers.

Namespace:  System.Net.Http.Formatting
Assembly:  System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)

Syntax

'Declaration
Public Function SelectCharacterEncoding ( _
    contentHeaders As HttpContentHeaders _
) As Encoding
'Usage
Dim instance As MediaTypeFormatter 
Dim contentHeaders As HttpContentHeaders 
Dim returnValue As Encoding 

returnValue = instance.SelectCharacterEncoding(contentHeaders)
public Encoding SelectCharacterEncoding(
    HttpContentHeaders contentHeaders
)
public:
Encoding^ SelectCharacterEncoding(
    HttpContentHeaders^ contentHeaders
)
member SelectCharacterEncoding : 
        contentHeaders:HttpContentHeaders -> Encoding
public function SelectCharacterEncoding(
    contentHeaders : HttpContentHeaders
) : Encoding

Parameters

  • contentHeaders
    Type: HttpContentHeaders

    The content headers.

Return Value

Type: System.Text.Encoding
The encoding that is the best match.

See Also

Reference

MediaTypeFormatter Class

System.Net.Http.Formatting Namespace