JSONException: Value of type java.lang.String cannot be converted to JSONObject

前端 未结 14 2454
别那么骄傲
别那么骄傲 2020-11-22 07:10

I have a JSON file with 2 JSON-Arrays in it: One Array for routes and one Array for sights.

A route should consist of several sights where the user gets navigated to

14条回答
  •  独厮守ぢ
    2020-11-22 07:46

    The 3 characters at the beginning of your json string correspond to Byte Order Mask (BOM), which is a sequence of Bytes to identify the file as UTF8 file.

    Be sure that the file which sends the json is encoded with utf8 (no bom) encoding.

    (I had the same issue, with TextWrangler editor. Use save as - utf8 (no bom) to force the right encoding.)

    Hope it helps.

提交回复
热议问题