I have some problems to get my UTF-8 site to work correctly.
Works fine under webrick and just after the reboot of lighttpd on
production.
But on the next visit to the site, text fetched from the DB containing
Ã?Ã?Ã? is replaced pÃ¥ “?”'s
Done so far: DB (MYSQL) *
charset set to UTF-8 on all tables.
*
controllers/application.rb
before_filter :set_charset
def set_charset @headers[“Content-Type”] = “text/html; charset=UTF-8”
end
suppress(ActiveRecord::StatementInvalid) do
ActiveRecord::Base.connection.execute ‘SET NAMES UTF8’
end
Could this be that the caching of the pages are non-utf8??
Solution anyone?
This does not help… The page is already sent in UTF-8 (Verified in
Firefox, page info)
The problem is that some of the text (not hardcoded into the view) that
are fecthed from the DB are messed up.
Works after a restart of the server… but returns to ??? instead of
Ã?Ã?Ã? after a while.
I finally managed to locate the default charset option in Webmin (Hosted
at http://www.textdrive.com)
(Apache Server/Virtual Server XYZ/Languages/Character set for
documents*)*.
When I set that one to UTF-8 the caching seems to save my precious Ã?Ã?Ã?'s
Let’s see if it stays that way…
Thanks you all for the inputs!!
Regards Jonas Montonen, http://bytadvd.se