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

◆ IdnEquivalent()

static string System.DomainNameHelper.IdnEquivalent ( string hostname)
inlinestaticpackage

Definition at line 139 of file DomainNameHelper.cs.

140 {
141 if (hostname.Length == 0)
142 {
143 return hostname;
144 }
145 bool flag = true;
146 foreach (char c in hostname)
147 {
148 if (c > '\u007f')
149 {
150 flag = false;
151 break;
152 }
153 }
154 if (flag)
155 {
156 return hostname.ToLowerInvariant();
157 }
158 string unicode = UriHelper.StripBidiControlCharacters(hostname, hostname);
159 try
160 {
161 string ascii = s_idnMapping.GetAscii(unicode);
163 {
164 throw new UriFormatException(System.SR.net_uri_BadUnicodeHostForIdn);
165 }
166 return ascii;
167 }
168 catch (ArgumentException)
169 {
170 throw new UriFormatException(System.SR.net_uri_BadUnicodeHostForIdn);
171 }
172 }
static bool ContainsCharactersUnsafeForNormalizedHost(string host)
static readonly IdnMapping s_idnMapping
static string net_uri_BadUnicodeHostForIdn
Definition SR.cs:54
Definition SR.cs:7

References System.DomainNameHelper.ContainsCharactersUnsafeForNormalizedHost(), System.SR.net_uri_BadUnicodeHostForIdn, System.DomainNameHelper.s_idnMapping, and System.UriHelper.StripBidiControlCharacters().