Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
EncodingInfo.cs
Go to the documentation of this file.
2
3namespace System.Text;
4
5public sealed class EncodingInfo
6{
7 public int CodePage { get; }
8
9 public string Name { get; }
10
11 public string DisplayName { get; }
12
13 internal EncodingProvider? Provider { get; }
14
15 public EncodingInfo(EncodingProvider provider, int codePage, string name, string displayName)
16 : this(codePage, name, displayName)
17 {
18 if (name == null || displayName == null || provider == null)
19 {
20 throw new ArgumentNullException((name == null) ? "name" : ((displayName == null) ? "displayName" : "provider"));
21 }
22 Provider = provider;
23 }
24
25 internal EncodingInfo(int codePage, string name, string displayName)
26 {
27 CodePage = codePage;
28 Name = name;
29 DisplayName = displayName;
30 }
31
33 {
34 return Provider?.GetEncoding(CodePage) ?? Encoding.GetEncoding(CodePage);
35 }
36
37 public override bool Equals([NotNullWhen(true)] object? value)
38 {
39 if (value is EncodingInfo encodingInfo)
40 {
41 return CodePage == encodingInfo.CodePage;
42 }
43 return false;
44 }
45
46 public override int GetHashCode()
47 {
48 return CodePage;
49 }
50}
override bool Equals([NotNullWhen(true)] object? value)
EncodingInfo(int codePage, string name, string displayName)
EncodingInfo(EncodingProvider provider, int codePage, string name, string displayName)
override int GetHashCode()
static Encoding GetEncoding(int codepage)
Definition Encoding.cs:593