Displaying 2 results from an estimated 2 matches for "fix_unicode_for_safari".
2006 Feb 05
2
working with rails and unicode
...in.rhtml:
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
database.yml:
development:
adapter: mysql
encoding: utf8
application.rb:
class ApplicationController < ActionController::Base
before_filter :set_charset
after_filter :fix_unicode_for_safari
def set_charset
@headers["Content-Type"] = "text/html; charset=utf-8"
end
# automatically and transparently fixes utf-8 bug
# with Safari when using xmlhttp
def fix_unicode_for_safari
if @headers["Content-Type"] == "text/html; charset=utf-8&quo...
2005 Dec 09
1
utf-8 BIG problems
...ike éàï....
But the display is then fucked up. i get wierd symbols
-------------------
Another situation:
I have seen a post here to add to environment.rb:
$KCODE = ''UTF8''
require ''jcode''
and to application.rb:
before_filter :configure_charsets
after_filter :fix_unicode_for_safari
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["Cont...