JSON Unterminated object at character android
<p>I have a <code>.json</code> file that contains JSON data. I created this file by simply Ctrl + C and Ctrl + V (from server output) Here's part of my file </p>

<pre><code>[{
    "ID": "109",
    "objectTypeID": "1",
    "names": [{
        "ID": 1,
        "code": "lt",
        "value": "Trak\u0173 salos pilis "
    }, {
        "ID": 2,
        "code": "en",
        "value": "Trakai Island Castle"
    }, {
        "ID": 3,
        "code": "ru",
        "value": "\u0422\u0440\u0430\u043a\u0430\u0439\u0441\u043a\u0438\u0439 \u0437\u0430\u043c\u043e\u043a"
    }, {
        "ID": 4,
        "code": "de",
        "value": "Kasteel van Trakai"
    }],
    "descriptions": [{
        "ID": 1,
        "code": "lt",
        "value": "&lt;div&gt;&lt;strong&gt;Paslap\u010di\u0173 m\u0117g\u0117jams ir ie&amp;scaron;kotojams&lt;\/strong&gt;&lt;\/div&gt;\r\n\r\n&lt;div&gt;Tiems, kurie domisi istorija, kurie m\u0117gsta paslaptingas vietoves, \u012f Trakus atkeliauti b\u016btina. Trak\u0173 pilis yra vienas labiausiai turist\u0173 lankom\u0173 objekt\u0173 Lietuvoje......"
    }]
}]
</code></pre>

<p>I have saved this file with <code>utf-8</code> encoding
As you can see there are lot of <code>Unicode Characters</code> and html elements like <code>&lt;div&gt;</code>, <code>&lt;strong&gt;</code> and so on....
Now I want to parse this file. Here's my java/android code</p>

<pre><code>private String getJSONString(File file){
        try {
            FileInputStream is = new FileInputStream(file.getAbsolutePath());
            int size = is.available();
            byte[] buffer = new byte[size];
            is.read(buffer);
            is.close();
            return new String(buffer, "UTF-8");
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }

private void object_parser(File file){
    String jsonString = getJSONString(file);
    JSONArray jsonArray = null;
    try {
            jsonArray = new JSONArray(jsonString);
            Log.d("OBJECTS_LIST_AAA", jsonArray.toString());
        } catch (JSONException e) {
            Log.d("OBJECTS_LIST_ERROR", e.getMessage()); // print error
            e.printStackTrace();
        }
    }
}
</code></pre>

<p>and  I get this error <code>Unterminated object at character 5641 of [{"ID":"109","objectTypeID":"1","names":[{"ID":1,"code":"lt","value":"Trak\u0173 salos pilis "},......</code>
I think that formating is missing in this file. </p>