Permalink
Browse files

Make sure encoding changes don't break 1.8

  • Loading branch information...
1 parent 821e15e commit 02c36cf5cb736a6c7321c8cb9a632a3a74344f25 @wycats wycats committed May 17, 2010
@@ -7,7 +7,7 @@ module ActionView
class OutputBuffer < ActiveSupport::SafeBuffer
def initialize(*)
super
- encode!
+ encode! if encoding_aware?
end
def <<(value)
@@ -106,6 +106,8 @@ def compile(template)
if !encoding && (template.source.encoding == Encoding::BINARY)
raise WrongEncodingError.new(template_source, Encoding.default_external)
end
+ else
+ erb = template.source.dup
end
result = self.class.erb_implementation.new(
@@ -1,9 +1,11 @@
require "abstract_unit"
-# These are the normal settings that will be set up by Railties
-# TODO: Have these tests support other combinations of these values
-Encoding.default_internal = "UTF-8"
-Encoding.default_external = "UTF-8"
+if "ruby".encoding_aware?
+ # These are the normal settings that will be set up by Railties
+ # TODO: Have these tests support other combinations of these values
+ Encoding.default_internal = "UTF-8"
+ Encoding.default_external = "UTF-8"
+end
class TestERBTemplate < ActiveSupport::TestCase
ERBHandler = ActionView::Template::Handlers::ERB

0 comments on commit 02c36cf

Please sign in to comment.