Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SurrogateChar.cs
Go to the documentation of this file.
3
4namespace System.Text;
5
6internal struct SurrogateChar
7{
8 private readonly char _lowChar;
9
10 private readonly char _highChar;
11
12 public const int MinValue = 65536;
13
14 public const int MaxValue = 1114111;
15
16 private const char surHighMin = '\ud800';
17
18 private const char surHighMax = '\udbff';
19
20 private const char surLowMin = '\udc00';
21
22 private const char surLowMax = '\udfff';
23
24 public char LowChar => _lowChar;
25
26 public char HighChar => _highChar;
27
28 public int Char => (_lowChar - 56320) | ((_highChar - 55296 << 10) + 65536);
29
30 public SurrogateChar(int ch)
31 {
32 if (ch < 65536 || ch > 1114111)
33 {
35 }
36 _lowChar = (char)(((ch - 65536) & 0x3FF) + 56320);
37 _highChar = (char)(((ch - 65536 >> 10) & 0x3FF) + 55296);
38 }
39
40 public SurrogateChar(char lowChar, char highChar)
41 {
42 if (lowChar < '\udc00' || lowChar > '\udfff')
43 {
45 int num = lowChar;
47 }
48 if (highChar < '\ud800' || highChar > '\udbff')
49 {
51 int num = highChar;
53 }
56 }
57}
static CultureInfo InvariantCulture
static string XmlInvalidHighSurrogate
Definition SR.cs:340
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string XmlInvalidSurrogate
Definition SR.cs:344
static string XmlInvalidLowSurrogate
Definition SR.cs:342
Definition SR.cs:7
SurrogateChar(char lowChar, char highChar)