Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetUnicode() [3/3]

unsafe string System.Globalization.IdnMapping.GetUnicode ( string ascii,
int index,
int count )
inline

Definition at line 112 of file IdnMapping.cs.

113 {
114 if (ascii == null)
115 {
116 throw new ArgumentNullException("ascii");
117 }
118 if (index < 0 || count < 0)
119 {
120 throw new ArgumentOutOfRangeException((index < 0) ? "index" : "count", SR.ArgumentOutOfRange_NeedNonNegNum);
121 }
122 if (index > ascii.Length)
123 {
124 throw new ArgumentOutOfRangeException("index", SR.ArgumentOutOfRange_Index);
125 }
126 if (index > ascii.Length - count)
127 {
128 throw new ArgumentOutOfRangeException("ascii", SR.ArgumentOutOfRange_IndexCountBuffer);
129 }
130 if (count > 0 && ascii[index + count - 1] == '\0')
131 {
132 throw new ArgumentException(SR.Argument_IdnBadPunycode, "ascii");
133 }
134 if (GlobalizationMode.Invariant)
135 {
136 return GetUnicodeInvariant(ascii, index, count);
137 }
138 fixed (char* ptr = ascii)
139 {
140 if (!GlobalizationMode.UseNls)
141 {
142 return IcuGetUnicodeCore(ascii, ptr + index, count);
143 }
144 return NlsGetUnicodeCore(ascii, ptr + index, count);
145 }
146 }
unsafe string NlsGetUnicodeCore(string asciiString, char *ascii, int count)
unsafe string IcuGetUnicodeCore(string asciiString, char *ascii, int count)
string GetUnicodeInvariant(string ascii, int index, int count)

References System.SR.Argument_IdnBadPunycode, System.SR.ArgumentOutOfRange_Index, System.SR.ArgumentOutOfRange_IndexCountBuffer, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.count, System.Globalization.IdnMapping.GetUnicodeInvariant(), System.Globalization.IdnMapping.IcuGetUnicodeCore(), System.index, System.Globalization.GlobalizationMode.Invariant, System.Globalization.IdnMapping.NlsGetUnicodeCore(), and System.Globalization.GlobalizationMode.UseNls.