How to set Browser Encoding?

C

Chirag Patel

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

Stefan Rusterholz

Chirag said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,218
Latest member
JolieDenha

Latest Threads

Top