97 lines
3.4 KiB
C#
97 lines
3.4 KiB
C#
using System;
|
|
|
|
namespace System.Text
|
|
{
|
|
/// <summary>Provides basic information about an encoding.</summary>
|
|
/// <filterpriority>2</filterpriority>
|
|
// Token: 0x020005F4 RID: 1524
|
|
[Serializable]
|
|
public sealed class EncodingInfo
|
|
{
|
|
// Token: 0x06003794 RID: 14228 RVA: 0x000BE730 File Offset: 0x000BC930
|
|
internal EncodingInfo(int cp)
|
|
{
|
|
this.codepage = cp;
|
|
}
|
|
|
|
/// <summary>Gets the code page identifier of the encoding.</summary>
|
|
/// <returns>The code page identifier of the encoding.</returns>
|
|
/// <filterpriority>2</filterpriority>
|
|
// Token: 0x17000AEC RID: 2796
|
|
// (get) Token: 0x06003795 RID: 14229 RVA: 0x000BE740 File Offset: 0x000BC940
|
|
public int CodePage
|
|
{
|
|
get
|
|
{
|
|
return this.codepage;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the human-readable description of the encoding.</summary>
|
|
/// <returns>The human-readable description of the encoding.</returns>
|
|
/// <filterpriority>2</filterpriority>
|
|
// Token: 0x17000AED RID: 2797
|
|
// (get) Token: 0x06003796 RID: 14230 RVA: 0x000BE748 File Offset: 0x000BC948
|
|
[MonoTODO]
|
|
public string DisplayName
|
|
{
|
|
get
|
|
{
|
|
return this.Name;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets the name registered with the Internet Assigned Numbers Authority (IANA) for the encoding.</summary>
|
|
/// <returns>The IANA name for the encoding. For more information about the IANA, see www.iana.org.</returns>
|
|
/// <filterpriority>2</filterpriority>
|
|
// Token: 0x17000AEE RID: 2798
|
|
// (get) Token: 0x06003797 RID: 14231 RVA: 0x000BE750 File Offset: 0x000BC950
|
|
public string Name
|
|
{
|
|
get
|
|
{
|
|
if (this.encoding == null)
|
|
{
|
|
this.encoding = this.GetEncoding();
|
|
}
|
|
return this.encoding.WebName;
|
|
}
|
|
}
|
|
|
|
/// <summary>Gets a value indicating whether the specified object is equal to the current <see cref="T:System.Text.EncodingInfo" /> object.</summary>
|
|
/// <returns>true if <paramref name="value" /> is a <see cref="T:System.Text.EncodingInfo" /> object and is equal to the current <see cref="T:System.Text.EncodingInfo" /> object; otherwise, false.</returns>
|
|
/// <param name="value">An object to compare to the current <see cref="T:System.Text.EncodingInfo" /> object.</param>
|
|
/// <filterpriority>1</filterpriority>
|
|
// Token: 0x06003798 RID: 14232 RVA: 0x000BE780 File Offset: 0x000BC980
|
|
public override bool Equals(object value)
|
|
{
|
|
EncodingInfo encodingInfo = value as EncodingInfo;
|
|
return encodingInfo != null && encodingInfo.codepage == this.codepage;
|
|
}
|
|
|
|
/// <summary>Returns the hash code for the current <see cref="T:System.Text.EncodingInfo" /> object.</summary>
|
|
/// <returns>A 32-bit signed integer hash code.</returns>
|
|
/// <filterpriority>1</filterpriority>
|
|
// Token: 0x06003799 RID: 14233 RVA: 0x000BE7AC File Offset: 0x000BC9AC
|
|
public override int GetHashCode()
|
|
{
|
|
return this.codepage;
|
|
}
|
|
|
|
/// <summary>Returns a <see cref="T:System.Text.Encoding" /> object that corresponds to the current <see cref="T:System.Text.EncodingInfo" /> object.</summary>
|
|
/// <returns>A <see cref="T:System.Text.Encoding" /> object that corresponds to the current <see cref="T:System.Text.EncodingInfo" /> object.</returns>
|
|
/// <filterpriority>1</filterpriority>
|
|
// Token: 0x0600379A RID: 14234 RVA: 0x000BE7B4 File Offset: 0x000BC9B4
|
|
public Encoding GetEncoding()
|
|
{
|
|
return Encoding.GetEncoding(this.codepage);
|
|
}
|
|
|
|
// Token: 0x040016A3 RID: 5795
|
|
private readonly int codepage;
|
|
|
|
// Token: 0x040016A4 RID: 5796
|
|
private Encoding encoding;
|
|
}
|
|
}
|