From 6ba235d5cc6867d7baabd5975fbc45cd08fc2e9c Mon Sep 17 00:00:00 2001 From: bsag Date: Sat, 13 May 2006 15:02:59 +0000 Subject: [PATCH] Set the default charset to UTF-8 by default (if it hasn't been previously set). This is supposed to fix problems with UTF-8 on Firefox. Fixes #279 git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@244 a4c988fc-2ded-0310-b66e-134b36920a42 --- tracks/app/controllers/application.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tracks/app/controllers/application.rb b/tracks/app/controllers/application.rb index 79fdb4a5..439bea7c 100644 --- a/tracks/app/controllers/application.rb +++ b/tracks/app/controllers/application.rb @@ -14,6 +14,13 @@ class ApplicationController < ActionController::Base before_filter :set_session_expiration before_filter :get_current_user + + after_filter :set_charset + + # By default, sets the charset to UTF-8 if it isn't already set + def set_charset + @headers["Content-Type"] ||= "text/html; charset=UTF-8" + end # Count the number of uncompleted actions, excluding those # in hidden contexts