views:

30

answers:

1

My default character encoding is Western (ISO latin 1, ISO-8859-1). I am using this code to change the character set:

<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />

My website only displays properly when I click on "Text Encoding" then "Western (ISO latin 1)" in the Safari view menu. Even when set on default (Safari text encoding menu), it still doesn't display properly (weird black-diamond question marks). I am using ruby on rails, if that might be an issue with the encoding.

A: 

You should add the following to your application_controller :

before_filter :headers_iso

def headers_iso
  headers["content-type"]= "text/html;charset=ISO-8859-1"
end
nathanvda
I'll try this when I have the chance, thanks for the answer!
alexy13
Hmm... Doesn't seem to work.
alexy13
I have a complete write-up here http://www.dixis.com/?p=48 of the troubles i had to go trough to get it to work for me. I was hoping that that single change was enough. Maybe you should read it. I hope it can help you.
nathanvda