Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The problem is that the character at index 33 is a carriage return control character.</p> <pre><code>&gt;&gt;&gt; s[33] u'\r' </code></pre> <p>According to the JSON spec, valid characters are:</p> <ul> <li><p>Any Unicode character except: <code>"</code>, <code>\</code>, and control-characters (<code>ord(char) &lt; 32</code>).</p></li> <li><p>The following character sequences are allowed: <code>\"</code>, <code>\\</code>, <code>\/</code>, <code>\b</code> (backspace), <code>\f</code> (form feed), <code>\n</code> (line-feed/new-line), <code>\r</code> (carriage return), <code>\t</code> (tab), or <code>\u</code> followed by four hexadecimal digits.</p></li> </ul> <p>However, in Python you're going to have to double escape control characters (unless the string is raw) because Python also interprets those control characters.</p> <pre><code>&gt;&gt;&gt; s = ur"""{"desc": "\u73cd\u54c1\u7f51-\u5168\u7403\u6f6e\u6d41\u5962\u54c1\u7f51\u7edc\u96f6\u552e\u5546 &lt;br \/&gt;\r\nhttp:\/\/www.zhenpin.com\/ &lt;br \/&gt;\r\n&lt;br \/&gt;\r\n200\u591a\u4e2a\u56fd\u9645\u4e00\u7ebf\u54c1\u724c\uff0c\u9876\u7ea7\u4e70\u624b\u5168\u7403\u91c7\u8d2d\uff0c100%\u6b63\u54c1\u4fdd\u969c\uff0c7\u5929\u65e0\u6761\u2026"}""" &gt;&gt;&gt; json.loads(s) {u'desc': u'\u73cd\u54c1\u7f51-\u5168\u7403\u6f6e\u6d41\u5962\u54c1\u7f51\u7edc\u96f6\u552e\u5546 &lt;br /&gt;\r\nhttp://www.zhenpin.com/ &lt;br /&gt;\r\n&lt;br /&gt;\r\n200\u591a\u4e2a\u56fd\u9645\u4e00\u7ebf\u54c1\u724c\uff0c\u9876\u7ea7\u4e70\u624b\u5168\u7403\u91c7\u8d2d\uff0c100%\u6b63\u54c1\u4fdd\u969c\uff0c7\u5929\u65e0\u6761\u2026'} </code></pre> <p>References:</p> <ul> <li><a href="http://www.json.org/" rel="nofollow noreferrer">http://www.json.org/</a></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload