Namespace: PdfSharp.Pdf.Internal
Use CodePagesEncodingProvider.Instance.GetEncoding(1252)
An encoder for PDF AnsiEncoding.
public sealed class AnsiEncoding : System.Text.Encoding, System.ICloneable
Inheritance Object → Encoding → AnsiEncoding
Implements ICloneable
public ReadOnlySpan<byte> Preamble { get; }
public string BodyName { get; }
public string EncodingName { get; }
public string HeaderName { get; }
public string WebName { get; }
public int WindowsCodePage { get; }
public bool IsBrowserDisplay { get; }
public bool IsBrowserSave { get; }
public bool IsMailNewsDisplay { get; }
public bool IsMailNewsSave { get; }
public bool IsSingleByte { get; }
public EncoderFallback EncoderFallback { get; set; }
public DecoderFallback DecoderFallback { get; set; }
public bool IsReadOnly { get; set; }
public int CodePage { get; }
public AnsiEncoding()
Gets the byte count.
public int GetByteCount(Char[] chars, int index, int count)
chars
Char[]
index
Int32
count
Int32
Gets the bytes.
public int GetBytes(Char[] chars, int charIndex, int charCount, Byte[] bytes, int byteIndex)
chars
Char[]
charIndex
Int32
charCount
Int32
bytes
Byte[]
byteIndex
Int32
Gets the character count.
public int GetCharCount(Byte[] bytes, int index, int count)
bytes
Byte[]
index
Int32
count
Int32
Gets the chars.
public int GetChars(Byte[] bytes, int byteIndex, int byteCount, Char[] chars, int charIndex)
bytes
Byte[]
byteIndex
Int32
byteCount
Int32
chars
Char[]
charIndex
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)
charCount
Int32
The number of characters to encode.
Int32
The maximum number of bytes produced by encoding the specified number of characters.
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)
byteCount
Int32
The number of bytes to decode.
Int32
The maximum number of characters produced by decoding the specified number of bytes.
Indicates whether the specified Unicode character is available in the ANSI code page 1252.
public static bool IsAnsi1252Char(char ch)
ch
Char
Maps Unicode to ANSI code page 1252.
public static char UnicodeToAnsi(char ch)
ch
Char