diff options
| author | Yehuda Katz <wycats@gmail.com> | 2011-11-30 11:45:18 -0800 |
|---|---|---|
| committer | Yehuda Katz <wycats@gmail.com> | 2011-11-30 11:45:18 -0800 |
| commit | a604983f8b8b873558fe7838d0bfcf0e0594daa6 (patch) | |
| tree | 9fdf9b4b26ebac0c4d5d0caf5fc5d14dc132c393 /actionpack/lib | |
| parent | 0092f0612d28ccdbba65bfc591d7fc2ff630b121 (diff) | |
| parent | 13cab6ef50ab665e634f2834acbb0212300a3797 (diff) | |
| download | rails-a604983f8b8b873558fe7838d0bfcf0e0594daa6.tar.gz rails-a604983f8b8b873558fe7838d0bfcf0e0594daa6.tar.bz2 rails-a604983f8b8b873558fe7838d0bfcf0e0594daa6.zip | |
Merge pull request #3816 from lest/exception-page-utf-8
fix exception page when template contains utf-8 and parameters contain utf-8
Diffstat (limited to 'actionpack/lib')
| -rw-r--r-- | actionpack/lib/action_view/template/error.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/template/error.rb b/actionpack/lib/action_view/template/error.rb index 587e37a84f..fe27e54037 100644 --- a/actionpack/lib/action_view/template/error.rb +++ b/actionpack/lib/action_view/template/error.rb @@ -89,10 +89,14 @@ module ActionView line_counter = start_on_line return unless source_code = source_code[start_on_line..end_on_line] - source_code.sum do |line| + extract = source_code.sum do |line| line_counter += 1 "#{indent}#{line_counter}: #{line}\n" end + + extract.encode! if extract.respond_to?(:encode!) + + extract end def sub_template_of(template_path) |
