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
Gb18030
Gets the chinese government standard encoding.
public static readonly Encoding Gb18030
Field Value
Korean
Gets the ks_c_5601-1987 encoding.
public static readonly Encoding Korean
Field Value
Latin13
Gets the iso-8859-13 encoding.
public static readonly Encoding Latin13
Field Value
Latin2
Gets the iso-8859-2 encoding.
public static readonly Encoding Latin2
Field Value
Latin3
Gets the iso-8859-53 encoding.
public static readonly Encoding Latin3
Field Value
Latin4
Gets the iso-8859-4 encoding.
public static readonly Encoding Latin4
Field Value
Latin5
Gets the iso-8859-5 encoding.
public static readonly Encoding Latin5
Field Value
UsAscii
Gets the US-ASCII encoding.
public static readonly Encoding UsAscii
Field Value
Utf16Be
Gets the UTF-16 (Big Endian) encoding.
public static readonly Encoding Utf16Be
Field Value
Utf16Le
Gets the UTF-16 (Little Endian) encoding.
public static readonly Encoding Utf16Le
Field Value
Utf32Be
Gets the UTF-32 (Little Endian) encoding.
public static readonly Encoding Utf32Be
Field Value
Utf32Le
Gets the UTF-32 (Little Endian) encoding.
public static readonly Encoding Utf32Le
Field Value
Utf8
Gets the UTF-8 encoding.
public static readonly Encoding Utf8
Field Value
Windows1250
Gets the Windows-1250 encoding.
public static readonly Encoding Windows1250
Field Value
Windows1251
Gets the Windows-1251 encoding.
public static readonly Encoding Windows1251
Field Value
Windows1252
Gets the Windows-1252 encoding.
public static readonly Encoding Windows1252
Field Value
Windows1253
Gets the Windows-1253 encoding.
public static readonly Encoding Windows1253
Field Value
Windows1254
Gets the Windows-1254 encoding.
public static readonly Encoding Windows1254
Field Value
Windows1255
Gets the Windows-1255 encoding.
public static readonly Encoding Windows1255
Field Value
Windows1256
Gets the Windows-1256 encoding.
public static readonly Encoding Windows1256
Field Value
Windows1257
Gets the Windows-1257 encoding.
public static readonly Encoding Windows1257
Field Value
Windows1258
Gets the Windows-1258 encoding.
public static readonly Encoding Windows1258
Field Value
Windows874
Gets the Windows-874 encoding.
public static readonly Encoding Windows874
Field Value
Methods
IsSupported(string)
Detects if a valid encoding has been found in the given charset string.
public static bool IsSupported(string charset)
Parameters
charset
stringThe 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
EncodingThe 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
stringThe 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
stringThe charset string.
Returns
- Encoding
An instance of the Encoding class or null.