localization

J

Josselin

I use successfully Thomas Fuchs' Localization plugin...

strings are written in /lang/fr_FR.rf file like :
Localization.define('fr_FR') do |l|
....
l.store 'Log out', 'Déconnexion'
....

but when displayed in the Browser (Safari for testing..)
I get the non UTF8 character set..

Déconnexion

to get the correct display , I have to modify Safari pref : default
encoding UTF8

why Safari doesn't recognize automatically the encoding ? shoudl I add
anything in my .rb view files ?

joss
 
F

f.svehla

but when displayed in the Browser (Safari for testing..)
I get the non UTF8 character set..

Déconnexion

You need to set the content-encoding in a HTTP header.
Put this im your application.rb:

before_filter :set_charset

def set_charset
ActiveRecord::Base.connection.execute("SET names 'UTF8'")

@headers["Content-Type"] ||= "text/html; charset=utf-8"
end
to get the correct display , I have to modify Safari pref : default
encoding UTF8


why Safari doesn't recognize automatically the encoding ? shoudl I add
anything in my .rb view files ?

It is technically impossible to guess the encoding correctly.
 
F

f.svehla

but when displayed in the Browser (Safari for testing..)
I get the non UTF8 character set..

Déconnexion

You need to set the content-encoding in a HTTP header.
Put this im your application.rb:

before_filter :set_charset

def set_charset
ActiveRecord::Base.connection.execute("SET names 'UTF8'")

@headers["Content-Type"] ||= "text/html; charset=utf-8"
end
to get the correct display , I have to modify Safari pref : default
encoding UTF8


why Safari doesn't recognize automatically the encoding ? shoudl I add
anything in my .rb view files ?

It is technically impossible to guess the encoding correctly.
 

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

Forum statistics

Threads
474,206
Messages
2,571,069
Members
47,677
Latest member
MoisesKoeh

Latest Threads

Top