internal static byte[] UrlEncodeUnicodeToBytesInternal(string s) { MemoryStream memoryStream = new MemoryStream(s.Length); foreach (char c in s) { HttpUtility.UrlEncodeChar(c, memoryStream, true); } return(memoryStream.ToArray()); }
internal static byte[] UrlEncodeToBytesInternal(byte[] bytes, int offset, int count) { MemoryStream memoryStream = new MemoryStream(count); int num = offset + count; for (int i = offset; i < num; i++) { HttpUtility.UrlEncodeChar((char)bytes[i], memoryStream, false); } return(memoryStream.ToArray()); }