I just needed to share this in case you come across the same issue:
I used the following lines to process JSON files in Livecode and the stack worked.
Over night the JSON files I was receiving weren't opening anymore in Livecode.
I couldn't understand as the online file checkers were showing me no issues with my JSON formatted text I was copy pasting into the browser.
Livecode debugger was escaping at the line JSONToArray without showing errors or providing hints.
Code: Select all
put url ("file:" & tFile) into tRawData
put JSONToArray(tData) into gArray
You can change the encoding in Notepad++ by Menu>Encoding>UTF-8
After re-saving the file Notepad++ as UTF-8 "only" I could now process the files in Livecode
After reading the forums I realized I could use textDecode in Livecode and this option works too and is obviously the better solution.
Code: Select all
put url ("file:" & tFile) into tRawData
put textEncode(tRawData,"UTF-8") into tData
put JSONToArray(tData) into gArray