[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How to set Browser Encoding?

Chirag Patel

6/29/2007 12:29:00 PM

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.

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

1 Answer

Stefan Rusterholz

6/29/2007 11:08:00 PM

0

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-....