diff --git a/actionpack/lib/action_view/template/handlers/erb.rb b/actionpack/lib/action_view/template/handlers/erb.rb index e3a7d96941d80..aab7baf442db7 100644 --- a/actionpack/lib/action_view/template/handlers/erb.rb +++ b/actionpack/lib/action_view/template/handlers/erb.rb @@ -17,7 +17,7 @@ class ERB < TemplateHandler def compile(template) require 'erb' - magic = $1 if template.source =~ /\A(<%#.*coding:\s*(\S+)\s*-?%>)/ + magic = $1 if template.source =~ /\A(<%#.*coding[:=]\s*(\S+)\s*-?%>)/ erb = "#{magic}<% __in_erb_template=true %>#{template.source}" ::ERB.new(erb, nil, erb_trim_mode, '@output_buffer').src end