From bcf0203497e6d10e658435c98b8b895fe024fb25 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 10 Sep 2013 16:01:36 +1000 Subject: [PATCH] fix encoding bug --- app/helpers/application_helper.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 07eaa91ca48..5b98c20c197 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -25,7 +25,10 @@ module ApplicationHelper def escape_unicode(javascript) if javascript - javascript.gsub(/\342\200\250/u, '
').gsub(/(<\/)/u, '\u003C/').html_safe + javascript = javascript.dup.force_encoding("utf-8") + javascript.gsub!(/\342\200\250/u, '
') + javascript.gsub!(/(<\/)/u, '\u003C/') + javascript.html_safe else '' end