Exemplo n.º 1
0
        public static string UrlDecode(byte[] bytes, int offset, int count, Encoding encoding)
        {
            if (bytes == null)
            {
                return(null);
            }
            int num = bytes.Length;

            if (num == 0 || count == 0)
            {
                return(string.Empty);
            }
            if (offset < 0 || offset >= num)
            {
                throw new ArgumentOutOfRangeException("offset");
            }
            if (count < 0 || count > num - offset)
            {
                throw new ArgumentOutOfRangeException("count");
            }
            if (encoding == null)
            {
                encoding = Encoding.UTF8;
            }
            return(HttpUtility.UrlDecodeInternal(bytes, offset, count, encoding));
        }
Exemplo n.º 2
0
        public static string UrlDecode(byte[] bytes, Encoding encoding)
        {
            if (encoding == null)
            {
                encoding = Encoding.UTF8;
            }
            int count;

            return((bytes != null) ? (((count = bytes.Length) != 0) ? HttpUtility.UrlDecodeInternal(bytes, 0, count, encoding) : string.Empty) : null);
        }