Permalink
Browse files

Give the ERB String the encoding of the original template

  • Loading branch information...
1 parent c66013e commit 50b7c0c104a87a9b650f4d257d986823cc34cf13 @wycats wycats committed May 24, 2010
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.