1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Make sure encoding changes don't break 1.8

This commit is contained in:
wycats 2010-05-17 19:39:38 +04:00
parent 821e15e5f2
commit 02c36cf5cb
2 changed files with 9 additions and 5 deletions

View file

@ -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 @@ module ActionView
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(

View file

@ -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