Table of Contents

Class TextEncoding

Namespace
AngleSharp.Text
Assembly
AngleSharp.dll

Various HTML encoding helpers.

public static class TextEncoding
Inheritance
TextEncoding
Inherited Members

Fields

Big5

Gets the Big5 encoding.

public static readonly Encoding Big5

Field Value

Encoding

Gb18030

Gets the chinese government standard encoding.

public static readonly Encoding Gb18030

Field Value

Encoding

Korean

Gets the ks_c_5601-1987 encoding.

public static readonly Encoding Korean

Field Value

Encoding

Latin13

Gets the iso-8859-13 encoding.

public static readonly Encoding Latin13

Field Value

Encoding

Latin2

Gets the iso-8859-2 encoding.

public static readonly Encoding Latin2

Field Value

Encoding

Latin3

Gets the iso-8859-53 encoding.

public static readonly Encoding Latin3

Field Value

Encoding

Latin4

Gets the iso-8859-4 encoding.

public static readonly Encoding Latin4

Field Value

Encoding

Latin5

Gets the iso-8859-5 encoding.

public static readonly Encoding Latin5

Field Value

Encoding

UsAscii

Gets the US-ASCII encoding.

public static readonly Encoding UsAscii

Field Value

Encoding

Utf16Be

Gets the UTF-16 (Big Endian) encoding.

public static readonly Encoding Utf16Be

Field Value

Encoding

Utf16Le

Gets the UTF-16 (Little Endian) encoding.

public static readonly Encoding Utf16Le

Field Value

Encoding

Utf32Be

Gets the UTF-32 (Little Endian) encoding.

public static readonly Encoding Utf32Be

Field Value

Encoding

Utf32Le

Gets the UTF-32 (Little Endian) encoding.

public static readonly Encoding Utf32Le

Field Value

Encoding

Utf8

Gets the UTF-8 encoding.

public static readonly Encoding Utf8

Field Value

Encoding

Windows1250

Gets the Windows-1250 encoding.

public static readonly Encoding Windows1250

Field Value

Encoding

Windows1251

Gets the Windows-1251 encoding.

public static readonly Encoding Windows1251

Field Value

Encoding

Windows1252

Gets the Windows-1252 encoding.

public static readonly Encoding Windows1252

Field Value

Encoding

Windows1253

Gets the Windows-1253 encoding.

public static readonly Encoding Windows1253

Field Value

Encoding

Windows1254

Gets the Windows-1254 encoding.

public static readonly Encoding Windows1254

Field Value

Encoding

Windows1255

Gets the Windows-1255 encoding.

public static readonly Encoding Windows1255

Field Value

Encoding

Windows1256

Gets the Windows-1256 encoding.

public static readonly Encoding Windows1256

Field Value

Encoding

Windows1257

Gets the Windows-1257 encoding.

public static readonly Encoding Windows1257

Field Value

Encoding

Windows1258

Gets the Windows-1258 encoding.

public static readonly Encoding Windows1258

Field Value

Encoding

Windows874

Gets the Windows-874 encoding.

public static readonly Encoding Windows874

Field Value

Encoding

Methods

IsSupported(string)

Detects if a valid encoding has been found in the given charset string.

public static bool IsSupported(string charset)

Parameters

charset string

The parsed charset string.

Returns

bool

True if a valid encdoing has been found, otherwise false.

IsUnicode(Encoding)

Checks if the provided encoding is any UTF-16 encoding.

public static bool IsUnicode(this Encoding encoding)

Parameters

encoding Encoding

The encoding to check.

Returns

bool

The result of the check (UTF-16BE, UTF-16LE).

Parse(string)

Tries to extract the encoding from the given http-equiv content string.

public static Encoding? Parse(string content)

Parameters

content string

The value of the attribute.

Returns

Encoding

The extracted encoding or null if the encoding is invalid.

Resolve(string?)

Resolves an Encoding instance given by the charset string. If the desired encoding is not found (or supported), then UTF-8 will be returned.

public static Encoding Resolve(string? charset)

Parameters

charset string

The charset string.

Returns

Encoding

An instance of the Encoding class or null.