Problems with jsonToArray and special chars like: æøå

Tore Nilsen tore.nilsen at
Wed Jun 6 06:16:37 EDT 2018

I have run into a problem with jsonToArray and the special Norwegian chars æøå. They do not show up in the keys of the array when the array is made from an external file. The external file is generated by LiveCode and the arrayToJSON function. All text are encoded to “UTF-8” before the array is made and passed to arrayToJSON. The script I use to generate the array on start up is as follows:

global kommuneArray

on preOpenStack

put empty into kommuneArray

put "file:" & specialFolderPath("resources")& "/Kommunedata.txt" into tFile

put textDecode(url tFile,"UTF-8") into tData

put jsonToArray(textDecode(tData,"UTF-8")) into kommuneArray

end preOpenStack

The array generated contains all the right information, but keys that should include æ, ø or å do not show up correctly. Any ideas anyone?

Best regards 
Tore Nilsen

More information about the Use-livecode mailing list