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

◆ UrlDecode() [1/3]

static byte[] System.Web.Util.HttpEncoder.UrlDecode ( byte[] bytes,
int offset,
int count )
inlinestaticpackage

Definition at line 293 of file HttpEncoder.cs.

294 {
296 {
297 return null;
298 }
299 int num = 0;
300 byte[] array = new byte[count];
301 for (int i = 0; i < count; i++)
302 {
303 int num2 = offset + i;
304 byte b = bytes[num2];
305 switch (b)
306 {
307 case 43:
308 b = 32;
309 break;
310 case 37:
311 if (i < count - 2)
312 {
313 int num3 = System.HexConverter.FromChar(bytes[num2 + 1]);
314 int num4 = System.HexConverter.FromChar(bytes[num2 + 2]);
315 if ((num3 | num4) != 255)
316 {
317 b = (byte)((num3 << 4) | num4);
318 i += 2;
319 }
320 }
321 break;
322 }
323 array[num++] = b;
324 }
325 if (num < array.Length)
326 {
327 byte[] array2 = new byte[num];
328 Array.Copy(array, array2, num);
329 array = array2;
330 }
331 return array;
332 }
static int FromChar(int c)
static bool ValidateUrlEncodingParameters([NotNullWhen(true)] byte[] bytes, int offset, int count)

References System.array, System.bytes, System.Array.Copy(), System.count, System.HexConverter.FromChar(), System.offset, and System.Web.Util.HttpEncoder.ValidateUrlEncodingParameters().

Referenced by System.Web.HttpUtility.UrlDecode(), System.Web.HttpUtility.UrlDecode(), and System.Web.HttpUtility.UrlDecodeToBytes().