Difference between ASCII Encoding and Encoding

I understand that Encoding can be used to initialize an object to perform any type of encoding, ASCII, Unicode, UTF-8, etc. It seems to me that all this is enough to perform any encoding, then what is the need for ASCIIEncoding?

+6
source share
1 answer

The Encoding class, in addition to the base class of all encoders, provides static property accessors for the named subclasses.

Encoding.ASCII returns an instance of ASCIIEncoding , which in turn subclasses Encoding and passes the code page 0x4e9f ( US-ASCII ) to the base constructor.

+11
source

Source: https://habr.com/ru/post/885733/


All Articles