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.
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
tag
in the header.
Now how you set http headers or output html is completly depending on
your framework. Consult your documentation.
Regards
Stefan
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.