Re: How to set Browser Encoding?



Chirag Patel wrote:
i want to set browser encoding through ruby code.
i want it to be western-European(windows).

my web page showing question mark for some html content . so i want to
do this setting. if i change it explicitly from encoding then its
working perfect.
i want it to do through code.

You can't really set it. You can tell the browser what it is through the
Content-Type header, e.g. "Content-Type: text/html; charset=utf-8 (that
is an HTTP header and not in the HTML code).
For standalone viewing (i.e. if the user saved the HTML to disk and
opens it from there, so no server is providing any header) there is the
<meta http-equiv="content-type" content="text/html; charset=utf-8"> tag
in the header.
Now how you set http headers or output html is completly depending on
your framework. Consult your documentation.

Regards
Stefan

--
Posted via http://www.ruby-forum.com/.

.



Relevant Pages

  • Re: Custom HTTP Header size limit
    ... you will need to modify all pages that you wish to decorate with ... metadata description for the search engine. ... > Search engines does not use the HTTP Header. ... All the HTML is sent as part of the HTTP Body. ...
    (microsoft.public.inetserver.iis)
  • Re: Get and Post
    ... > Can anyone tell me what is the difference between Get and Post in HTML? ... as a browser) sends an HTTP request containing only an HTTP header. ... a GET request fetches some information from the server but doesn't ...
    (comp.programming)
  • Re: W3C complience checker and conformance
    ... don't need to use a META element to do so. ... to be handled as error-fuxup-ed HTML). ... carrying a character encoding specification in the ... HTTP header, just as the W3C FAQ says - by suitably configuring the ...
    (alt.html)
  • Re: Using lxml to screen scrap a site, problem with charset
    ... alphabet (windows-1251 encoding). ... The sites HTML doesn't have the <META ... You can also create a parser with an encoding override: ...
    (comp.lang.python)
  • Re: Custom HTTP Header size limit
    ... Should description & keyword be added to all pages on a web site or just ... > Search engines does not use the HTTP Header. ... All the HTML is sent as part of the HTTP Body. ... What you want to edit is the HTML, ...
    (microsoft.public.inetserver.iis)