Skip to content
This repository
Browse code

Give the ERB String the encoding of the original template

  • Loading branch information...
commit 50b7c0c104a87a9b650f4d257d986823cc34cf13 1 parent c66013e
Yehuda Katz authored May 24, 2010
2  actionpack/lib/action_view/template_handlers/erb.rb
@@ -12,7 +12,7 @@ class ERB < TemplateHandler
12 12
 
13 13
       def compile(template)
14 14
         magic = $1 if template.source =~ /\A(<%#.*coding[:=]\s*(\S+)\s*-?%>)/
15  
-        erb = "#{magic}<% __in_erb_template=true %>#{template.source}"
  15
+        erb = "#{magic}<% __in_erb_template=true %>#{template.source}".force_encoding(template.source.encoding)
16 16
         ::ERB.new(erb, nil, erb_trim_mode, '@output_buffer').src
17 17
       end
18 18
     end

0 notes on commit 50b7c0c

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