JSON::ParserError: 757: unexpected token at '{

前端 未结 4 1326
醉梦人生
醉梦人生 2021-01-05 00:43

the current hash is

{\\\"report_name\\\"=>\\\"Study/Control: ABIRATERONE ACETATE - 20151413355\\\", \\\"left_mue_start_date\\\"=>\\\"02-26-2015\\\",          


        
4条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-05 00:56

    Last time when I got this issue, since the json file that I got from a API that contains a BOM

    UTF-8 BOM is a sequence of bytes (EF BB BF) What's different between UTF-8 and UTF-8 without BOM?

    at the beginning of that string, but you know that part wouldn't display or as readable when we got the string from response. I try to use Ruby JSON to parse it, but I failed, I got the same exception with yours. just a reminder for others, when you get a Json response. By the way, this would be no problem while you are handling that in javascript, but with problems in Python or Ruby languages.

提交回复
热议问题