Brief Version!

  • Thread starter Thread starter Gaurav Vaish \(www.EduJiniOnline.com\)
  • Start date Start date
Thanks for the useful link and comment.
Any way I can force the IIS to send the page in the charset I want when
there is no accept-charset in the request header (something like default
charset option in the server)?

It's not the IIS that sends the charset.
It's in the ASPX page itself. Add an attribute to the page directive.

<%@ Page ContentType="text/html; charset=utf-8" ... %>



--
Happy Hacking,
Gaurav Vaish | http://www.mastergaurav.com
http://www.edujinionline.com
http://articles.edujinionline.com/webservices
-------------------
 
thought my post is too long the short version is:
i have this tag in my HTML file served by IIS

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

IE show this page correctly but I need to detect the characterset of the
response and

HttpWebResponse webresp = (HttpWebResponse)(webrq.GetResponse());
...
console.WriteLine(webresp.CharacterSet);

dumps this on screen

ISO-8859-1

instead of utf-8 ! why?
 
Thanks for the useful link and comment.
Any way I can force the IIS to send the page in the charset I want when
there is no accept-charset in the request header (something like default
charset option in the server)?


"Gaurav Vaish (www.EduJiniOnline.com)"
 
adding Accept-Charset: utf-8 didnt solve the problem:

webrq.Headers.Add(HttpRequestHeader.AcceptCharset, Encoding.UTF8.WebName);

I dunno what is wrong with it?
 
Back
Top