Encoding

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/27

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:55 PM on 8/7/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

28 Terms

1
New cards

Encoding

A class in the System.Text namespace that represents character encodings and provides operations for converting between Unicode characters and encoded byte sequences. Domain: C# → .NET → System.Text → Character Encoding

2
New cards

Encoding.UTF8

Gets a UTF-8 encoding, which represents Unicode characters using a variable number of bytes.

3
New cards

Encoding.Unicode

Gets a UTF-16 little-endian encoding, where text is represented using 16-bit code units.

4
New cards

Encoding.BigEndianUnicode

Gets a UTF-16 big-endian encoding, which stores the most significant byte of each 16-bit code unit first.

5
New cards

Encoding.UTF32

Gets a UTF-32 little-endian encoding, which represents Unicode code points using 32-bit code units.

6
New cards

Encoding.ASCII

Gets an ASCII encoding, which represents the 128 standard ASCII characters.

7
New cards

Encoding.Latin1

Gets the Latin-1 encoding, which directly represents the first 256 Unicode code points using one byte each.

8
New cards

byte[] bytes = Encoding.UTF8.GetBytes(text);

Converts the characters in text into a byte array using UTF-8 encoding.

9
New cards

string text = Encoding.UTF8.GetString(bytes);

Decodes a UTF-8 encoded byte array into a C# string.

10
New cards

int byteCount = Encoding.UTF8.GetByteCount(text);

Calculates how many bytes are required to encode the specified text using UTF-8.

11
New cards

int charCount = Encoding.UTF8.GetCharCount(bytes);

Calculates how many UTF-16 char values will result from decoding the specified UTF-8 bytes.

12
New cards

char[] chars = Encoding.UTF8.GetChars(bytes);

Decodes a UTF-8 byte array into an array of characters.

13
New cards

int maxBytes = Encoding.UTF8.GetMaxByteCount(charCount);

Calculates the maximum possible number of bytes that may be required to encode a specified number of characters.

14
New cards

int maxChars = Encoding.UTF8.GetMaxCharCount(byteCount);

Calculates the maximum possible number of characters that may result from decoding a specified number of bytes.

15
New cards

Encoding encoding = Encoding.GetEncoding("utf-8");

Gets an Encoding object for an encoding specified by name.

16
New cards

Encoding.Default

Gets the default encoding for the current .NET environment.

17
New cards

Unrepresentable Character

A character that cannot be represented by a particular character encoding, such as many Unicode characters when using ASCII.

18
New cards

Encoding encoding = Encoding.GetEncoding("ASCII", EncoderFallback.ExceptionFallback, DecoderFallback.ExceptionFallback);

Configures the encoding to throw an exception when a character cannot be represented instead of silently replacing it.

19
New cards

Encoder

A stateful object that converts characters into bytes while preserving conversion state when text is processed in multiple chunks.

20
New cards

Decoder

A stateful object that converts encoded bytes into characters while preserving conversion state when byte data is processed in multiple chunks.

21
New cards

Encoding Preamble

A sequence of bytes that may appear at the beginning of encoded data to provide information about its character encoding.

22
New cards

byte[] preamble = encoding.GetPreamble();

Returns the sequence of bytes representing the preamble associated with the specified encoding.

23
New cards

read-only sequence

Encoding Preamble Property provides the preamble associated with an encoding as a ________________ of bytes. It can be used to inspect whether that particular encoding supplies a preamble.

24
New cards

Byte Order Mark (BOM)

A byte sequence that may appear at the beginning of Unicode-encoded text to identify its encoding and, where relevant, its byte order.

25
New cards

Unicode Code Point

A numerical value assigned to a Unicode character or text element, conventionally written in a form such as U+0041 for A.

26
New cards

UTF-16 Code Unit

A 16-bit unit used by UTF-16 to represent Unicode text; some Unicode code points require one code unit, while others require two.

27
New cards

Surrogate Pair

Two UTF-16 code units—a high surrogate followed by a low surrogate—used together to represent a Unicode code point outside the Basic Multilingual Plane.

28
New cards

char

A ____ in C# represents one UTF-16 code unit, not necessarily one complete Unicode character. Therefore, some Unicode characters require 2 of these values.