This works alright:
1)
Code: Select all
put "{" & quote & "response" & quote & ":" & quote & "complesso" & quote & "}" into TheJson
put JSONToArray(TheJson) into tArray
This doesn't:
2)
Code: Select all
put "{" & quote & "response" & quote & ":" & quote & "più complesso" & quote & "}" into TheJson
put JSONToArray(TheJson) into tArray
Error on the function: stack "lib_FMS_API": execution error at line n/a (External handler execution error: could not decode JSON: unable to decode byte 0x9d near '"pi') near "could not decode JSON: unable to decode byte 0x9d near '"pi'"
This works, but "response" on the array is: "pi complesso" (missing the accented ù):
3)
Code: Select all
put "{" & quote & "response" & quote & ":" & quote & "più complesso" & quote & "}" into TheJson
put textDecode(TheJson,"UTF8") into TheJson
put JSONToArray(TheJson) into tArray
More: from FileMaker Server API I really receive this Json:
4)
Code: Select all
put "{" & quote & "response" & quote & ":" & quote & "pi√π complesso" & quote & "}" into TheJson
put textDecode(TheJson,"UTF8") into TheJson
put JSONToArray(TheJson) into tArray
Erron on the function: stack "lib_FMS_API": execution error at line n/a (External handler execution error: could not decode JSON: unable to decode byte 0x9d near '"pi') near "could not decode JSON: unable to decode byte 0x9d near '"pi'"
BUT if I textDecode the array, instead of the JSON, I get the correct result for the key "response"="più complesso":
5)
Code: Select all
put "{" & quote & "response" & quote & ":" & quote & "pi√π complesso" & quote & "}" into TheJson
put JSONToArray(TheJson) into tArray
put textDecode(tArray["response"],"UTF8") into TheResponse
Is there something I have to know if I use jsonimport instead of mergJSONDecode, that clearly has some problem?
Thanks