diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-05-10 14:36:18 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-05-10 14:36:18 -0300 |
commit | 9a43816928f07c4ed988fb47545d219eff55e28a (patch) | |
tree | ee37a34695a2754ceda85748e950399c85d8fef8 /activesupport/lib | |
parent | 5602c73eca9a5c764621fcbf4ce0b7613d543699 (diff) | |
download | rails-9a43816928f07c4ed988fb47545d219eff55e28a.tar.gz rails-9a43816928f07c4ed988fb47545d219eff55e28a.tar.bz2 rails-9a43816928f07c4ed988fb47545d219eff55e28a.zip |
Fix syntax error on Ruby 2.0
Since Ruby 2.0 is UTF-8 by default we need to explictly say that the
encoding of this file is US-ASCII
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/json/encoding.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/json/encoding.rb b/activesupport/lib/active_support/json/encoding.rb index 71dfbf3323..75655f88d3 100644 --- a/activesupport/lib/active_support/json/encoding.rb +++ b/activesupport/lib/active_support/json/encoding.rb @@ -1,3 +1,5 @@ +#encoding: us-ascii + require 'active_support/core_ext/object/to_json' require 'active_support/core_ext/module/delegation' require 'active_support/json/variable' @@ -123,9 +125,9 @@ module ActiveSupport def escape_html_entities_in_json=(value) self.escape_regex = \ if @escape_html_entities_in_json = value - /\xe2\x80(\xa8|\xa9)|[\x00-\x1F"\\><&]/ + /\xe2\x80\xa8|\xe2\x80\xa9|[\x00-\x1F"\\><&]/ else - /\xe2\x80(\xa8|\xa9)|[\x00-\x1F"\\]/ + /\xe2\x80\xa8|\xe2\x80\xa9|[\x00-\x1F"\\]/ end end |