The namespace contains classes that represent ASCII and Unicode character encodings; abstract base classes for converting blocks of characters to and from blocks of bytes; and a helper class that manipulates and formats objects without creating intermediate instances of .

The encoding classes are primarily intended to convert between different encodings or code pages and a Unicode encoding. (UTF-16) encoding is used internally by the .NET Framework, and encoding is often used for storing character data to ensure portability across machines and cultures.

The classes derived from enable you to choose a fallback strategy, which determines how characters that cannot be encoded into a sequence of bytes, or bytes that cannot be decoded into characters, are handled. You can choose one of the following:

Exception fallback. You can choose to throw exceptions on data errors either by using a flag that is available in some class constructors or by using the and classes. If you are concerned about the integrity of the data stream, throwing on an exception is recommended.

Replacement fallback. You can use the and classes to silently change a character to "?" or to the Unicode replacement character (U+FFFD).

Best-fit fallback. This option maps a character in one encoding to a character in another encoding. Best fit fallback is often not recommended because it can cause data loss and confusion, and is slower than simple "?" character replacements. However, for ANSI code pages the best-fit behavior is the default.

The class is designed for operations that perform extensive manipulations on a single string. Unlike the class, the class is mutable and provides better performance when concatenating or deleting strings.

For more information about , see Character Encoding in the .NET Framework and the MSDN blog Shawn Steele's Thoughts about Windows and .NET Framework Globalization APIs.