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

◆ GetEncodedBytes()

static void System.Net.WebUtility.GetEncodedBytes ( byte[] originalBytes,
int offset,
int count,
byte[] expandedBytes )
inlinestaticprivate

Definition at line 653 of file WebUtility.cs.

654 {
655 int num = 0;
656 int num2 = offset + count;
657 for (int i = offset; i < num2; i++)
658 {
659 byte b = originalBytes[i];
660 char c = (char)b;
661 if (IsUrlSafeChar(c))
662 {
663 expandedBytes[num++] = b;
664 continue;
665 }
666 if (c == ' ')
667 {
668 expandedBytes[num++] = 43;
669 continue;
670 }
671 expandedBytes[num++] = 37;
672 expandedBytes[num++] = (byte)HexConverter.ToCharUpper(b >> 4);
673 expandedBytes[num++] = (byte)HexConverter.ToCharUpper(b);
674 }
675 }
static bool IsUrlSafeChar(char ch)

References System.count, System.Net.WebUtility.IsUrlSafeChar(), System.offset, and System.HexConverter.ToCharUpper().

Referenced by System.Net.WebUtility.UrlEncode(), and System.Net.WebUtility.UrlEncodeToBytes().