Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
HttpEncoderUtility.cs
Go to the documentation of this file.
2
3namespace System.Web.Util;
4
5internal static class HttpEncoderUtility
6{
7 public static bool IsUrlSafeChar(char ch)
8 {
9 if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9'))
10 {
11 return true;
12 }
13 switch (ch)
14 {
15 case '!':
16 case '(':
17 case ')':
18 case '*':
19 case '-':
20 case '.':
21 case '_':
22 return true;
23 default:
24 return false;
25 }
26 }
27
28 [return: NotNullIfNotNull("str")]
29 internal static string UrlEncodeSpaces(string str)
30 {
31 if (str == null || !str.Contains(' '))
32 {
33 return str;
34 }
35 return str.Replace(" ", "%20");
36 }
37}
static string UrlEncodeSpaces(string str)