In this blog post, we will learn how to make a csv file utf-8 encoded we will create a .csv file that uses UTF-8 character encoding.
How to make a cSV file utf-8 encoded?
Problem
We need to save csv file in utf-8 encoding, When we use Create file action in Power Automate to create CSV file that contain Arabic characters or any other UTF-8 character encoding, The file created with Stanga character as shown in the following file .
So we need to solve this issue and create a correct file encoded by UTF-8.
Solution
To solve this issue we need to create the file correctly and make the reader to guess that the file created is encoded by UTF-8.
So we need to add the BOM characters to the content of the file as when you generate .csv file in Power Automate, it does not include BOM.
BOM is 3 characters (EF BB BF) to mark the file is encoded as UTF-8.
We will perform this using the help of the decodeUriComponent function that Return a string that replaces escape characters with decoded versions.
So in the create File you will concatenate your CSV file content withe the decodeUriComponent (‘%EF%BB%BF’)
So the solution of how to make a csv file utf-8 encoded is to add 3 BOM characters in front of the .csv file content before saving it.
Save and run Your flow, Now it will create the .csv file that uses UTF-8 character encoding
See Also
- How To Export Power Apps To Excel File? | Power Automate
- How To Format Text In PowerApps? PowerApps Convert Text To Other Data Types
- Alternate Row Color In Gallery PowerApps: Simplest Way
- Check If PowerApps Contains Substring
- PowerApps If Statement And Nested If With Example
- Environment Variable In Power Platform With Examples
- Model Driven App With SharePoint Data Source
- PowerApps Get Day Of Week Date
Join us
- Subscribe to Power Platform Geeks.