Problem : JSON file which store top level JSON arrays just wouldn’t parse (using org.json library), and gives out an error message like – “Json Array should begin with [ …..”. Editors like Vim or Gedit or IntelliJ show no errors (or any character before “[” )in these files.
Reason : Byte order marker character is prefixed to the file content (this was probably added when I converted the files from UTF-16 to UTF-8).
- Open the file in Vim.
- Run command- :set nobomb
- save and exit. (:wq)
Kj [/.] Sreekumar programs computers as a hobby and profession. Into programming from his school days, Sree uses Codemarvels to key in facts and fixes he finds interesting while working on different projects. Some of the articles here give away a few shades of his philosophical leanings too.