i have change my db to utf8-general-ci, now all the characters are
the database, i need this for exporting to pdf en excel. now i can also
from csv, characters like Ã©Ã Ã¯…
But the display is then fucked up. i get wierd symbols
I have seen a post here to add to environment.rb:
$KCODE = ‘UTF8’
and to application.rb:
def parse_errors(obj) return nil if obj.nil? str = "<ul>" obj.errors.each_full do |msg| str += "<li>" + msg +"</li>" end str += "</ul>" return str end def configure_charsets @headers["Content-Type"] = "text/html; charset=utf-8" suppress(ActiveRecord::StatementInvalid) do ActiveRecord::Base.connection.execute 'SET NAMES UTF8' end end
then the display is correct but when i export to pdf and excel i get the
characters again. and when i want to import form csv, u can read here
but i need all correct characters in the database, cuz i also work with
soap and ajax.
I prefer to use the 1st solution (correct import and export, incorrect
and find a solution for the display.
Can anyone help me??
thanks in advance