Re: Problems with jsonToArray and special chars like: æøå

Tore Nilsen tore.nilsen at me.com
Wed Jun 6 08:06:31 EDT 2018


Hi Panos.

This does not work, and it is somewhat similar to what I tried initially, although I am certain I should use textDecode when importing text to LiveCode, as per the Dictionary. Also note that tFile only holds the url to the file containing the JSON, and your suggestion only encodes the file path. The strange thing is that the text I try to import was encoded as “UTF-8” when it was initially exported from LiveCode. It shows up all right in all other applications that can read .txt files.

When I do only a single run of text decoding, no array is created. When I do a double decoding, the array is created, but the chars in question does not show up in the keys of the array. Another thing that puzzles me is that som values, like -0.2 or -0.4 will show up with som additional zeros in the JSON-text. When I add a space between the minus operator and the number, it is displayed correctly.

I am still at odd with what may be the cause of this.

Regards Tore  

> 6. jun. 2018 kl. 13:40 skrev panagiotis merakos via use-livecode <use-livecode at lists.runrev.com>:
> 
> on preOpenStack
>  put empty into kommuneArray
>  put "file:" & specialFolderPath("resources")& "/Kommunedata.txt" into
> tFile
>  put textEncode(tFile,"UTF-8") into tData
>  put jsonToArray(tData) into kommuneArray
> end preOpenStack
> 
> Best,
> Panos
> --




More information about the Use-livecode mailing list