title: Why do I get the error "unexpected end of string while parsing JSON string" when decoding a URI-encoded JSON string?
body: <p>I'm trying to POST some JSON data to my Perl script, but the JSON module seems to be unable to cope with this string:</p>
  
  <pre class="lang-none prettyprint-override"><code>[{"":"#","jednostka":"","login":"SA"}]
  </code></pre>
  
  <p>I used <code>encodeURIComponent()</code> in JavaScript, so my string actually looks like this:</p>
  
  <pre class="lang-none prettyprint-override"><code>[{%22%22:%22#%22,%22jednostka%22:%22%22,%22login%22:%22SA%22}]
  </code></pre>
  
  <p>Error log:</p>
  
  <pre class="lang-none prettyprint-override"><code>JSON::PP::decode_error('unexpected end of string while parsing JSON string') called at C:\strawberry\perl\lib/JSON/PP.pm line 837
  |   JSON::PP::string() called at C:\strawberry\perl\lib/JSON/PP.pm line 960
  |   JSON::PP::object() called at C:\strawberry\perl\lib/JSON/PP.pm line 724
  |   JSON::PP::value() called at C:\strawberry\perl\lib/JSON/PP.pm line 907
  |   JSON::PP::array() called at C:\strawberry\perl\lib/JSON/PP.pm line 725
  |   JSON::PP::value() called at C:\strawberry\perl\lib/JSON/PP.pm line 688
  |   JSON::PP::PP_decode_json('JSON::PP=HASH(0xd0c2534)', '[{%22%22:%22#%22,%22jednostka%22:%22%22,%22login%22:%22SA%22}]', 0) called at C:\strawberry\perl\lib/JSON/PP.pm line 148
  </code></pre>