ASCIIEncoding 和 Encoding 之间的区别
据我所知,Encoding 可用于初始化对象来执行任何类型的编码,ASCII、Unicode、UTF-8 等。 在我看来,所有这些都足以执行任何类型的编码,那么需要 ASCIIEncoding 什么呢?
I understand that Encoding can be used to initialize object to perform any type of Encoding, ASCII, Unicode, UTF-8 etc.
It appears to me that all these are sufficient for performing any kind of encoding, then what is the need for ASCIIEncoding?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Encoding
类除了是所有编码器的基类之外,还为指定的子类提供静态属性访问器。Encoding.ASCII
返回ASCIIEncoding
的实例,该实例又是Encoding
的子类并传递代码页0x4e9f
(< a href="http://msdn.microsoft.com/en-us/library/dd317756%28VS.85%29.aspx" rel="noreferrer">US-ASCII) 到基本构造函数。The
Encoding
class, in addition to being the base class of all encoders, provides static property accessors to the named subclasses.Encoding.ASCII
returns an instance ofASCIIEncoding
which, in turn, subclassesEncoding
and passes the codepage0x4e9f
(US-ASCII) to the base constructor.