Overview
Working on a simple integration using "external services" to POST to a custom endpoint. Discovered that all UTF-8 characters, including many common currency symbols, are coming through as question marks or other nonsense characters.
The MIME type for the external service is set to application/json.
After discovering this issue, I did a bunch of testing against postman-echo.com/post and hookbin.com.
I do have 'enhanced' external services enabled (not the legacy). I have tested using application/json;charset=UTF-8 and it has no impact.
Two examples:
Example 1:
acute (é), grave (è), circumflex (â, î or ô), tilde (ñ)
comes through as
acute (�), grave (�), circumflex (�, � or �), tilde (�)
Example 2:
¥ · £ · € · $ · ¢ · ₡ · ₢ · ₣ · ₤ · ₥ · ₦ · ₧ · ₨ · ₩ · ₪ · ₫ · ₭ · ₮ · ₯ · ₹
comes through as
� � � � ? � $ � � � ? � ? � ? � ? � ? � ? � ? � ? � ? � ? � ? � ? � ? � ? � ?",
It seems like a bug but regular support is unlikely to will not take this up, so posting here to see if anyone has successfully used external services to POST strings with UTF-8 characters? Pasting a truncated external service definition below that I've been using for testing.
{
"swagger":"2.0",
"info":{
"description":"testing string encoding external services",
"version":"0.1",
"title":"testingmadness"
},
"paths":{
"/":{
"post":{
"consumes":[
"application/json"
],
"produces":[
"text/html"
],
"parameters":[
{
"in":"body",
"name":"body",
"required":false,
"schema":{
"$ref":"#/definitions/Model0"
}
}
],
"responses":{
"200":{
"description":"Definition generated from Swagger Inspector",
"schema":{
"type":"string"
}
}
}
}
}
},
"definitions":{
"Model0":{
"properties":{
"ttl":{
"type":"string"
}
}
}
}
}
UPDATE - Package to Test
I've added the flow + ext service + named credential to a package if anyone with premiere support is willing to push on this, as its a rather bodacious bug.
https://test.salesforce.com/packaging/installPackage.apexp?p0=04tc0000000GktN
To configure / test
- install package in sandbox
- create a 'bin' on hookbin.com update
- update named credential to point at the bin
- run the flow ('UTF8 Encoding Test 3')