fix encoding bug
This commit is contained in:
parent
edf6f3012d
commit
bcf0203497
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue