diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-11-05 19:03:37 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-11-05 19:03:37 +0000 |
commit | 7b453d28449527aeac18395c471e3010a15fbb31 (patch) | |
tree | be9c46a7a4baaf998df62c524d0ed32a2558a743 /activesupport/lib/active_support/json/encoders | |
parent | 4d5b913fcf73b352f5a426c862dbeb483d67a9a3 (diff) | |
download | rails-7b453d28449527aeac18395c471e3010a15fbb31.tar.gz rails-7b453d28449527aeac18395c471e3010a15fbb31.tar.bz2 rails-7b453d28449527aeac18395c471e3010a15fbb31.zip |
Fix unicode JSON regexp for Onigurama compatibility. Closes #6494.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5432 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/json/encoders')
-rw-r--r-- | activesupport/lib/active_support/json/encoders/core.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/json/encoders/core.rb b/activesupport/lib/active_support/json/encoders/core.rb index 483471ee3e..d8571be9c8 100644 --- a/activesupport/lib/active_support/json/encoders/core.rb +++ b/activesupport/lib/active_support/json/encoders/core.rb @@ -32,7 +32,7 @@ module ActiveSupport ESCAPED_CHARS[s] }.gsub(/([\xC0-\xDF][\x80-\xBF]| [\xE0-\xEF][\x80-\xBF]{2}| - [\xF0-\xF7][\x80-\xBF]{3})+/ux) { |s| + [\xF0-\xF7][\x80-\xBF]{3})+/nx) { |s| s.unpack("U*").pack("n*").unpack("H*")[0].gsub(/.{4}/, '\\\\u\&') } + '"' end |