2019-12-09 17:25:54 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace Swan {
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Contains useful constants and definitions.
|
|
|
|
|
/// </summary>
|
2019-12-10 20:01:19 +01:00
|
|
|
|
// [Obsolete("NEED", false)]
|
2019-12-09 17:25:54 +01:00
|
|
|
|
public static partial class Definitions {
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The MS Windows codepage 1252 encoding used in some legacy scenarios
|
|
|
|
|
/// such as default CSV text encoding from Excel.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static readonly Encoding Windows1252Encoding;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The encoding associated with the default ANSI code page in the operating
|
|
|
|
|
/// system's regional and language settings.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static readonly Encoding CurrentAnsiEncoding;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Initializes the <see cref="Definitions"/> class.
|
|
|
|
|
/// </summary>
|
|
|
|
|
static Definitions() {
|
|
|
|
|
CurrentAnsiEncoding = Encoding.GetEncoding(default(Int32));
|
|
|
|
|
try {
|
|
|
|
|
Windows1252Encoding = Encoding.GetEncoding(1252);
|
|
|
|
|
} catch {
|
|
|
|
|
// ignore, the codepage is not available use default
|
|
|
|
|
Windows1252Encoding = CurrentAnsiEncoding;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|