4

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

  1. install package in sandbox
  2. create a 'bin' on hookbin.com update
  3. update named credential to point at the bin
  4. run the flow ('UTF8 Encoding Test 3')

1 Answer 1

0

PM for External Services indicated that this is a known issue which will be addressed by SUmmer 21

The team is working on addressing a number of issues here where we are currently ignoring the "consumes" directive, including the charset. By default Latin-1 is used and thus any other Unicode characters are coming across as Latin-1 encoded which is not UTF-8 which then show as garbled characters on the server or in flow in case the "produces" directive has UTF-8 as the charset.

You can expect better support here in the Summer '21 release

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .