I have several problems with UTF-8 files with BOM, several tokens are being generated at the beginning of the pages, this causes several problems in json file reads and de-emphasis of HTML components. Almost impossible to discover because the tokens are invisible. I looked in google for a way to change all files to UTF-8 without BOM and found a perl script to remove the BOM signature but it did not work. Someone could help. I need a script that will change all project files.
More information on the problem and the script can be found here
My solution for now is to get my files cleaned and saved in UTF-8 without BOM, but there are several files, so I thought of a script, but I have no idea how to do it.
The momentary solution to the json token problems I did so to solve (POG):
1.Retrieve the string from the first key found. For tokens are generated before this key. That solves momentarily. But it's a gambiarra.
json = json.substring(json.indexOf("{"),json.length);
objeto = $.parseJSON(json);