Skip to content

Commit

Permalink
Fix syntax error on Ruby 2.0
Browse files Browse the repository at this point in the history
Since Ruby 2.0 is UTF-8 by default we need to explictly say that the
encoding of this file is US-ASCII
  • Loading branch information
rafaelfranca committed May 10, 2013
1 parent 5602c73 commit 9a43816
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions 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'
Expand Down Expand Up @@ -123,9 +125,9 @@ class << self
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

Expand Down

0 comments on commit 9a43816

Please sign in to comment.