Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Give the ERB String the encoding of the original template

  • Loading branch information...
commit 50b7c0c104a87a9b650f4d257d986823cc34cf13 1 parent c66013e
@wycats wycats authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  actionpack/lib/action_view/template_handlers/erb.rb
View
2  actionpack/lib/action_view/template_handlers/erb.rb
@@ -12,7 +12,7 @@ class ERB < TemplateHandler
def compile(template)
magic = $1 if template.source =~ /\A(<%#.*coding[:=]\s*(\S+)\s*-?%>)/
- erb = "#{magic}<% __in_erb_template=true %>#{template.source}"
+ erb = "#{magic}<% __in_erb_template=true %>#{template.source}".force_encoding(template.source.encoding)
::ERB.new(erb, nil, erb_trim_mode, '@output_buffer').src
end
end

0 comments on commit 50b7c0c

Please sign in to comment.
Something went wrong with that request. Please try again.