addFeatures REST call results in incorrect characters

188
0
02-21-2024 01:30 PM
Labels (1)
WarrenMedernach
Occasional Contributor III

Hello,

We have an Azure Logic App that is gathering data and sending a JSON string to the addFeatures method of a Feature Layer (SQL).  Everything is working perfectly, with the exception of when the values contain language special characters like: ç, ã, á, etc.  In these instances the special characters are substituted with: Ã§,ã, á, etc

I have checked all Content-Type settings and they are all set to: application/json; charset=UTF-8

I can see the properly formatted JSON being input, and have successfully tested the JSON manually on the addFeatures page of the layer, and resulting values in the table are correct.

During the call the Logic App is encoding the string by pre-fixing the double quotes with '\', so it seems like the addFeatures method is not decoding properly.

Below is the simplified JSON inputs to demonstrate.

Input JSON (copy/pasting this manually into the addFeatures page works as expected:

[
 {
  "attributes": {
    "CP": 13,
    "Name": "Mineração",
    "Confidential": 0,
  }
 }
]

REST call encoding:

{
  "f": "json",
  "features": "[{\"attributes\":{\"CP\":13,\"Name\":\"Mineração\",\"Confidential\":0}}]",
  "token": "sometoken"
}

The resulting Name value in the SQL table is: Mineração

The Name column storing this value is nvarchar, and the database collation is SQL_Latin1_General_CP1_CI_AS

Any suggestions on how to resolve this, or other things to check, would be greatly appreciated.

0 Kudos
0 Replies