JSONException: Unterminated string
<p>This is my code:</p>

<pre><code>JSONObject msgObject = JSONObject.fromObject(msg);
</code></pre>

<p>I then get a JSONException:</p>

<pre><code>net.sf.json.JSONException: Unterminated string at character 239 of {...}
</code></pre>

<p>What am I doing wrong?</p>

<p>Thanks.</p>

<p>edit:<br>
I create a test.txt file:<br><br>
<code>{"source":"a\n"}</code><br><br>
the test method is this:<br><br>
<code>
Scanner cin = new Scanner(new File("test1.txt"), "utf-8");<br>
JSONObject msgObject = JSONObject.fromObject(msg);<br>
</code><br>
I got this:<br>
key:source&amp;value:a</p>
