| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- // Licensed to the .NET Foundation under one or more agreements.
- // The .NET Foundation licenses this file to you under the MIT license.
- // See the LICENSE file in the project root for more information.
- namespace System.Text
- {
- public sealed class EncodingInfo
- {
- internal EncodingInfo(int codePage, string name, string displayName)
- {
- CodePage = codePage;
- Name = name;
- DisplayName = displayName;
- }
- public int CodePage { get; }
- public string Name { get; }
- public string DisplayName { get; }
- public Encoding GetEncoding()
- {
- return Encoding.GetEncoding(CodePage);
- }
- public override bool Equals(object value)
- {
- EncodingInfo that = value as EncodingInfo;
- if (that != null)
- {
- return this.CodePage == that.CodePage;
- }
- return false;
- }
- public override int GetHashCode()
- {
- return CodePage;
- }
- }
- }
|