Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upActiveSupport::JSON used in json_common.rb #73
Comments
This comment has been minimized.
This comment has been minimized.
Thanks! |
This comment has been minimized.
This comment has been minimized.
AFAICS this is still the case with the most recent version of I know, that there has been quite some discussion about this, e.g. in #86 and #138 (comment). But if I'm not mistaken, a patch has landed in Rails since late 2013, which provides compatibility between ActiveSupport::JSON and pure JSON (see rails/rails#12862 for details). It's included since So if it is fine to no longer support |
There seems to be an error in json_common.rb, which we found out due to a bug in the ActiveSupport::JSON module.
ActiveSupport::JSON does not encode 16+ bits characters, but chops them off – as we found out the other day.
JSON.generate however, does not have this bug and does the job well.
The point is that in json_common.rb on line 7, the library uses JSON.parse, but on line 11, the .to_json uses ActiveSupport::JSON, which is another library that contains that bug.
Shouldn't the library use JSON.generate here?