【发布时间】:2014-03-22 19:35:39
【问题描述】:
我有一个已转义的字符串,我想将其解析为 JSON,但使用 rails 时不断出错
{\"content\":{\"Soass__text_plain__abc_of_study\":\"Some of Study\",\"Dodeeedd\":
...........
........lots more of the string then comes some \u002d1 etc
第 160 行的解析错误: ...“id”:\u002d1
JSON::ParserError: 399: unexpected token at '{"spacer":"http://s.c.xxx.yyyy.com/scds/common/u/img/spacer.gif","i18n_get_discovered_upload":"\u003cstrong\u003eGet discovered\u003c/strong\u003e for your work! Add your videos, images, documents...","bg_promo_1":
我怎样才能 JSON 解析这个?
【问题讨论】:
-
试试这个服务来定位你的 JSON 中的坏字符:jsonlint.com
标签: ruby-on-rails json parsing