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)