Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

ActiveSupport::JSON.decode doesn't unescape unicode characters

#1592

>> s = "{\"test\": \"\\u201cquoted\\u201d\"}"
=> "{\"test\": \"\\u201cquoted\\u201d\"}"
>> ActiveSupport::JSON.decode(s)
=> {"test"=>"\\u201cquoted\\u201d"}
>> require 'json'
=> []
>> JSON.parse(s)
=> {"test"=>"“quoted”"}

Reported by chad.ingram (at me) · December 17th, 2008 @ 07:31 PM

State: invalid
Milestone: 3.x
Assigned to: nobody
Importance: none

Activity

  1. Lukas Fittl
    Lukas Fittl

    Works for me as of Rails 2.3.2.

    I suggest closing this ticket.

    May 2nd, 2009 @ 01:09 AM

  2. Ken Miller
    Ken Miller

    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.

    June 30th, 2009 @ 07:42 PM

  3. Ken Miller
    Ken Miller

    Actually, scratch that. Above code fails in OS X as well, but works in 2.3.2.

    June 30th, 2009 @ 07:54 PM

  4. Christian Seiler
    Christian Seiler

    yep, works in 2.3.5. Fails in 2.2.3

    February 10th, 2010 @ 01:35 PM

  5. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  6. Oriol Gual
    Oriol Gual
    • 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”"}

    December 27th, 2010 @ 03:13 PM

  7. kevmoo
    kevmoo

    Also confirmed fixed in 3.0.3

    Close it!

    January 5th, 2011 @ 03:25 AM

  8. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to invalid

    January 27th, 2011 @ 06:20 AM