Everything works fine when the JSON is ANSI coded.
However when I switch the JSON to UTF-8 coded, Servoy prompts this strange error:
JAVASCRIPT ERROR
net.stuff.plugin.velocityreport.org.json.JSONException: Expected a ‘:’ after a key at 3 [character 4 line 1]
Does someone know why?
I also tried to give plugins.file.readTXTFile() the second argument “UTF-8” as codepage, but that did not change anything.
There are UTF-8 files with and without a BOM (Byte Order Mark) at the beginning.
That BOM is the sequence EF BB BF.
When saving my JSON file as “UTF-8 without BOM” (can be done easily with Notepad++ in menu ‘Coding / Convert to UTF-8 without BOM’), everything works well.
So to be able to process also “UTF-8 with BOM”, VelocityReport.fromJSON() could check if the BOM is there, and then ignore or strip it before processing.
As a workaround, one has to make sure to process always UTF-8 without BOM.