views:

25

answers:

1

I have a site which is in two languages: English and French.

There is a form. For some reason some of the error messages on the form display the French accents while other error messages will not. The pages are encoded in charset=utf-8.

Any ideas why this is happening and how I can fix this. I have even encoded the translations using both the accent and the UTF coding set for the accents.

I get the following results:

which shoes the unicode characters instead of the accent they are supposed to show as in être

thanks

A: 

I suppose you have Rails 2.3.8. The problem is on the translation_helper file that automatically encodes translations. To avoid this, you must append '_hmtl' or '.html' to the translation key or you can monkeypatch the translation helper.

More about Rails XSS protection: Rails 3 Security Strategy (that has also been backported to Rails 2.3.6+)

Vlad Zloteanu
Thanks for your help. I am a newbie so for me I am using yaml files for the translations. What is the translation key and where do I find it. Or how can I monkeypatch my application and will this work when I put it up on someones server when the site goes liveAlso I have a drop down menu with the countries populated in it. When I load the menu with the french words for the countries not using a key but loading directly from my database I see the UTF-8 codes for the accents and not the accents. Any ideasÉ
Mitchell Gould