Skip to content

Commit df7fcaf

Browse files
Merge pull request #285173 from ecfan/uuf
[Content Health][UUF] Non-Unicode payload - Use base64ToBinary, not base64ToString
2 parents d9cd350 + d124ea0 commit df7fcaf

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

articles/logic-apps/support-non-unicode-character-encoding.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Handle non-Unicode characters in Azure Logic Apps by converting tex
44
ms.service: azure-logic-apps
55
ms.topic: how-to
66
ms.reviewer: estfan, azla
7-
ms.date: 01/04/2024
7+
ms.date: 08/21/2024
88
---
99

1010
# Support non-Unicode character encoding in Azure Logic Apps
@@ -13,25 +13,26 @@ ms.date: 01/04/2024
1313

1414
When you work with text payloads, Azure Logic Apps infers the text is encoded in a Unicode format, such as UTF-8. You might have problems receiving, sending, or processing characters with different encodings in your workflow. For example, you might get corrupted characters in flat files when working with legacy systems that don't support Unicode.
1515

16-
To work with text that has other character encoding, apply base64 encoding to the non-Unicode payload. This step prevents Logic Apps from assuming the text is in UTF-8 format. You can then convert any .NET-supported encoding to UTF-8 using Azure Functions.
16+
To work with text that has other character encoding, apply base64ToBinary encoding to the non-Unicode payload. This step prevents Azure Logic Apps from assuming the text is in UTF-8 format. You can then convert any .NET-supported encoding to UTF-8 using Azure Functions.
1717

18-
This solution works with both *multi-tenant* and *single-tenant* workflows. You can also [use this solution with the AS2 connector](#convert-payloads-for-as2).
18+
This solution works with both *multitenant* and *single-tenant* workflows. You can also [use this solution with the AS2 connector](#convert-payloads-for-as2).
1919

2020
## Convert payload encoding
2121

22-
First, check that your trigger can correctly identify the content type. This step ensures that Logic Apps no longer assumes the text is UTF-8.
22+
First, check that your trigger can correctly identify the content type. This step ensures that Azure Logic Apps no longer assumes the text is UTF-8.
2323

24-
In triggers and actions that have the property **Infer Content Type**, select **No**. You can usually find this property in the operation's **Add parameters** list. However, if the operation doesn't include this property, the content type is set by the inbound message.
24+
In triggers and actions that have the property **Infer Content Type**, select **No**. You can usually find this property in the operation's **Advanced parameters** list. However, if the operation doesn't include this property, the content type is set by the inbound message.
2525

2626
The following list shows some of the connectors where you can disable automatically inferring the content type:
27+
2728
* [OneDrive](/connectors/onedrive/)
2829
* [Azure Blob Storage](/connectors/azureblob/)
2930
* [Azure File Storage](/connectors/azurefile/)
3031
* [File System](/connectors/filesystem/)
3132
* [Google Drive](/connectors/googledrive/)
3233
* [SFTP - SSH](/connectors/sftpwithssh/)
3334

34-
If you're using the Request trigger for `text/plain` content, you must set the `charset` parameter that is in the call's `Content-Type` header. Otherwise, characters might become corrupted, or the parameter doesn't match the payload's encoding format. For more information, review [how to handle the `text/plain` content type](logic-apps-content-type.md#text-plain).
35+
If you're using the **Request** trigger for `text/plain` content, you must set the `charset` parameter that is in the call's `Content-Type` header. Otherwise, characters might become corrupted, or the parameter doesn't match the payload's encoding format. For more information, review [how to handle the `text/plain` content type](logic-apps-content-type.md#text-plain).
3536

3637
For example, the HTTP trigger converts the incoming content to UTF-8 when the `Content-Type` header is set with the correct `charset` parameter:
3738

@@ -49,7 +50,7 @@ If you set the `Content-Type` header to `application/octet-stream`, you also mig
4950

5051
## Base64 encode content
5152

52-
Before you [base64 encode](workflow-definition-language-functions-reference.md#base64) content to a string, make sure that you [converted the text to UTF-8](#convert-payload-encoding). Otherwise, characters might return corrupted.
53+
Before you [base64 encode](workflow-definition-language-functions-reference.md#base64) content to a string, make sure that you [convert the text to UTF-8](#convert-payload-encoding). Otherwise, characters might return corrupted.
5354

5455
Next, convert any .NET-supported encoding to another .NET-supported encoding. Review the [Azure Functions code example](#azure-functions-version) or the [.NET code example](#net-version):
5556

@@ -210,6 +211,8 @@ Example output:
210211

211212
If you need to send a non-Unicode payload from your workflow, do the steps for [converting the payload to UTF-8](#convert-payload-encoding) in reverse. Keep the text in UTF-8 as long as possible within your system. Next, use the same function to convert the base64-encoded UTF-8 characters to the required encoding. Then, apply base64 decoding to the text, and send your payload.
212213

214+
When you consume the return value from Azure Functions, make sure to use the [**base64ToBinary** function](workflow-definition-language-functions-reference.md#base64tobinary), not the **base64ToString** function.
215+
213216
## Convert payloads for AS2
214217

215218
You can also use this solution with non-Unicode payloads in the [AS2 v2 connector](logic-apps-enterprise-integration-as2.md). If you don't convert payloads that you pass to AS2 to UTF-8, you might experience problems with the payload interpretation. These problems might result in a mismatch with the MIC hash between the partners because of misinterpreted characters.

0 commit comments

Comments
 (0)