aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/lib/action_view/template/error.rb2
-rw-r--r--railties/test/application/middleware/exceptions_test.rb3
2 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/template/error.rb b/actionpack/lib/action_view/template/error.rb
index fe27e54037..ee74bb47d3 100644
--- a/actionpack/lib/action_view/template/error.rb
+++ b/actionpack/lib/action_view/template/error.rb
@@ -94,7 +94,7 @@ module ActionView
"#{indent}#{line_counter}: #{line}\n"
end
- extract.encode! if extract.respond_to?(:encode!)
+ extract.force_encoding("UTF-8") if extract.respond_to?(:encode!)
extract
end
diff --git a/railties/test/application/middleware/exceptions_test.rb b/railties/test/application/middleware/exceptions_test.rb
index a9cde42be8..aedc4fe648 100644
--- a/railties/test/application/middleware/exceptions_test.rb
+++ b/railties/test/application/middleware/exceptions_test.rb
@@ -99,7 +99,7 @@ module ApplicationTests
app_file 'app/views/foo/index.html.erb', <<-ERB
<% raise 'boooom' %>
- ✓
+ ✓測試テスト시험
ERB
app_file 'config/routes.rb', <<-RUBY
@@ -110,6 +110,7 @@ module ApplicationTests
post '/foo', :utf8 => '✓'
assert_match(/boooom/, last_response.body)
+ assert_match(/測試テスト시험/, last_response.body)
end
end
end