My problem is that when I send POST to form, then they’re wrong characters.
I send extended ASCII:
█████████
after POST I get:
–“â–ˆ ▄▓██████
My code:
req = (HttpWebRequest)HttpWebRequest.Create("http://forum.com/);
req.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705;)";
req.Method = "POST";
req.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
req.Headers.Add("Accept-Language: en-us,en;q=0.5");
req.Headers.Add("Accept-Encoding: gzip,deflate");
req.Headers.Add("Accept-Charset: ISO-8859-1;q=0.7,*;q=0.7");
req.KeepAlive = true;
req.Headers.Add("Keep-Alive: 300");
req.Referer = "http://www.google.com/";
req.ContentType = "application/x-www-form-urlencoded";
req.CookieContainer = _cookieJar;
req.ServicePoint.Expect100Continue = false;
byte[] bytedata =
Encoding.GetEncoding("iso-8859-1").GetBytes("subject=" + HttpUtility.UrlEncode(subject.Replace("_", " ")) +
"&description=" + HttpUtility.UrlEncode(description));
Stream requestStream = req.GetRequestStream();
requestStream.Write(bytedata, 0, bytedata.Length);
requestStream.Close();
try
{
response = (HttpWebResponse)req.GetResponse();
}
catch (Exception ex)
{
MessageBox.Show("oh noes...");
}
break;
Encoding on site is ISO-8859-1.
I DID IT: