PDFsharp-net6

AnsiEncoding

Namespace: PdfSharp.Pdf.Internal

Caution

Use CodePagesEncodingProvider.Instance.GetEncoding(1252)


An encoder for PDF AnsiEncoding.

public sealed class AnsiEncoding : System.Text.Encoding, System.ICloneable

Inheritance ObjectEncodingAnsiEncoding
Implements ICloneable

Properties

Preamble

public ReadOnlySpan<byte> Preamble { get; }

Property Value

ReadOnlySpan<Byte>

BodyName

public string BodyName { get; }

Property Value

String

EncodingName

public string EncodingName { get; }

Property Value

String

HeaderName

public string HeaderName { get; }

Property Value

String

WebName

public string WebName { get; }

Property Value

String

WindowsCodePage

public int WindowsCodePage { get; }

Property Value

Int32

IsBrowserDisplay

public bool IsBrowserDisplay { get; }

Property Value

Boolean

IsBrowserSave

public bool IsBrowserSave { get; }

Property Value

Boolean

IsMailNewsDisplay

public bool IsMailNewsDisplay { get; }

Property Value

Boolean

IsMailNewsSave

public bool IsMailNewsSave { get; }

Property Value

Boolean

IsSingleByte

public bool IsSingleByte { get; }

Property Value

Boolean

EncoderFallback

public EncoderFallback EncoderFallback { get; set; }

Property Value

EncoderFallback

DecoderFallback

public DecoderFallback DecoderFallback { get; set; }

Property Value

DecoderFallback

IsReadOnly

public bool IsReadOnly { get;  set; }

Property Value

Boolean

CodePage

public int CodePage { get; }

Property Value

Int32

Constructors

AnsiEncoding()

public AnsiEncoding()

Methods

GetByteCount(Char[], Int32, Int32)

Gets the byte count.

public int GetByteCount(Char[] chars, int index, int count)

Parameters

chars Char[]

index Int32

count Int32

Returns

Int32

GetBytes(Char[], Int32, Int32, Byte[], Int32)

Gets the bytes.

public int GetBytes(Char[] chars, int charIndex, int charCount, Byte[] bytes, int byteIndex)

Parameters

chars Char[]

charIndex Int32

charCount Int32

bytes Byte[]

byteIndex Int32

Returns

Int32

GetCharCount(Byte[], Int32, Int32)

Gets the character count.

public int GetCharCount(Byte[] bytes, int index, int count)

Parameters

bytes Byte[]

index Int32

count Int32

Returns

Int32

GetChars(Byte[], Int32, Int32, Char[], Int32)

Gets the chars.

public int GetChars(Byte[] bytes, int byteIndex, int byteCount, Char[] chars, int charIndex)

Parameters

bytes Byte[]

byteIndex Int32

byteCount Int32

chars Char[]

charIndex Int32

Returns

Int32

GetMaxByteCount(Int32)

When overridden in a derived class, calculates the maximum number of bytes produced by encoding the specified number of characters.

public int GetMaxByteCount(int charCount)

Parameters

charCount Int32
The number of characters to encode.

Returns

Int32
The maximum number of bytes produced by encoding the specified number of characters.

GetMaxCharCount(Int32)

When overridden in a derived class, calculates the maximum number of characters produced by decoding the specified number of bytes.

public int GetMaxCharCount(int byteCount)

Parameters

byteCount Int32
The number of bytes to decode.

Returns

Int32
The maximum number of characters produced by decoding the specified number of bytes.

IsAnsi1252Char(Char)

Indicates whether the specified Unicode character is available in the ANSI code page 1252.

public static bool IsAnsi1252Char(char ch)

Parameters

ch Char

Returns

Boolean

UnicodeToAnsi(Char)

Maps Unicode to ANSI code page 1252.

public static char UnicodeToAnsi(char ch)

Parameters

ch Char

Returns

Char