This project is archived and is in readonly mode.
ActiveSupport::JSON.decode doesn't unescape unicode characters
Reported by chad.ingram (at me) | December 17th, 2008 @ 07:31 PM | in 3.x
>> s = "{\"test\": \"\\u201cquoted\\u201d\"}"
=> "{\"test\": \"\\u201cquoted\\u201d\"}"
>> ActiveSupport::JSON.decode(s)
=> {"test"=>"\\u201cquoted\\u201d"}
>> require 'json'
=> []
>> JSON.parse(s)
=> {"test"=>"“quoted”"}
Comments and changes to this ticket
-
Ken Miller June 30th, 2009 @ 07:42 PM
I'm seeing this in 2.1.2, but only on Linux (not Mac OS X). Upgrading to 2.3.x soon, but it might be worth investigating whether this is platform-dependent in 2.3 as well.
-
Ken Miller June 30th, 2009 @ 07:54 PM
Actually, scratch that. Above code fails in OS X as well, but works in 2.3.2.
-
Oriol Gual December 27th, 2010 @ 03:13 PM
- Importance changed from to
This seems fixed right now (using 1.9.2 with 3.0.3)
s = "{"test": "\u201cquoted\u201d"}" => "{"test": "\u201cquoted\u201d"}" s => "{"test": "\u201cquoted\u201d"}" ActiveSupport::JSON.decode(s) => {"test"=>"“quoted”"}
-
Rohit Arondekar January 27th, 2011 @ 06:20 AM
- State changed from new to invalid
-
csnk May 18th, 2011 @ 08:17 AM
We are the professional shirts manufacturer, shirts supplier, shirts factory, custom shirts.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>