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).
Fix:
- Open the file in Vim.
- Run command- :set nobomb
- save and exit. (:wq)

Sreekumar (KJ) has been a hobby programmer from school days. Codemarvels is his personal blog from the year 2010, where he writes about technology, philosophy, society and a bit about physics.
He now runs a conversational AI company – DheeYantra – focusing his efforts to help businesses improve operational efficiency using digital employees powered by AI.