mscorlib(4.0.0.0) API with additions
EncodingInfo.cs
1 namespace System.Text
2 {
5  public sealed class EncodingInfo
6  {
7  private int iCodePage;
8 
9  private string strEncodingName;
10 
11  private string strDisplayName;
12 
15  public int CodePage => iCodePage;
16 
19  public string Name => strEncodingName;
20 
23  public string DisplayName => strDisplayName;
24 
25  internal EncodingInfo(int codePage, string name, string displayName)
26  {
27  iCodePage = codePage;
28  strEncodingName = name;
29  strDisplayName = displayName;
30  }
31 
35  {
36  return Encoding.GetEncoding(iCodePage);
37  }
38 
43  public override bool Equals(object value)
44  {
45  EncodingInfo encodingInfo = value as EncodingInfo;
46  if (encodingInfo != null)
47  {
48  return CodePage == encodingInfo.CodePage;
49  }
50  return false;
51  }
52 
55  public override int GetHashCode()
56  {
57  return CodePage;
58  }
59  }
60 }
Represents a character encoding.To browse the .NET Framework source code for this type,...
Definition: Encoding.cs:15
override bool Equals(object value)
Gets a value indicating whether the specified object is equal to the current T:System....
Definition: EncodingInfo.cs:43
int CodePage
Gets the code page identifier of the encoding.
Definition: EncodingInfo.cs:15
string DisplayName
Gets the human-readable description of the encoding.
Definition: EncodingInfo.cs:23
static Encoding GetEncoding(int codepage)
Returns the encoding associated with the specified code page identifier.
Definition: Encoding.cs:1249
string Name
Gets the name registered with the Internet Assigned Numbers Authority (IANA) for the encoding.
Definition: EncodingInfo.cs:19
Encoding GetEncoding()
Returns a T:System.Text.Encoding object that corresponds to the current T:System.Text....
Definition: EncodingInfo.cs:34
Specifies that the class can be serialized.
Provides basic information about an encoding.
Definition: EncodingInfo.cs:5
override int GetHashCode()
Returns the hash code for the current T:System.Text.EncodingInfo object.
Definition: EncodingInfo.cs:55