Hello,
as the title of the subject already suggests: I want to create a .csv file that uses UTF-8 character encoding.
The background is the following:
On a daily basis I retrieve data from Dynamics 365, create a new .csv table and save it in our SharePoint.
For example, if it was a table displaying the past invoices, ideally it would look like
currency, amount, invoice_id, customer_name
EUR, 100, 20514_abc, some_näme
The flow works totally fine so far - however, customer_name from the example above would be displayed as "some_näme" ...
All I got from my research so far is this post and I am still quite lost. What am I missing?
Thanks a lot in advance - I am looking forward to your replies.
Solved! Go to Solution.
Hi @v-litu-msft ,
.csv file is a kind of text file. If you encode it in UTF-8 format, there are two ways to save it.
- Text only
- Byte Order Mark(BOM)+Text
BOM is 3 characters (EF BB BF) to mark the file is encoded as UTF-8.
When you generate .csv file in Power Automate, it does not include BOM.
So, when you open the .csv file in excel, special characters(i.e. Korean) will be broken.
The solution is to add 3 BOM characters in front of the .csv file content before saving it.
Hi @Anonymous,
This is a known issue and not caused by Flow, there is no solution could do in the Flow side, sorry.
https://www.i18nqa.com/debug/utf8-debug.html
As a workaround, the only way could do in my mind is to use the text replace feature to replace these "ä" to "ä":
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks a lot for your fast reply!
Hopefully it's going to be implemented one day, better soon than late.
Unfortunately, the workaround won't be a satisfying solution for our issue...
It's way too much effort to use the find and replace option any time for several letters that aren't encoded properly - for any single .csv table created on a daily basis.
Maybe there are others having the same issue who just found another workaround that might fit here?
To my awareness the built in csv creator in flow generates a csv file with UTF-8, the problem stems from the system thinking the csv file is some other format than UTF-8.
If you are opening the file in excel, you can use the import function and specify that it is utf-8, which should fix the issue.
This guide is old, but the concept is still the same:
https://www.itg.ias.edu/content/how-import-csv-file-uses-utf-8-character-encoding-0
Hi @v-litu-msft ,
.csv file is a kind of text file. If you encode it in UTF-8 format, there are two ways to save it.
- Text only
- Byte Order Mark(BOM)+Text
BOM is 3 characters (EF BB BF) to mark the file is encoded as UTF-8.
When you generate .csv file in Power Automate, it does not include BOM.
So, when you open the .csv file in excel, special characters(i.e. Korean) will be broken.
The solution is to add 3 BOM characters in front of the .csv file content before saving it.
Hi, I have the same issue, but I cannot understand the solution.
How do I use the line of code, when I want to export the data in a table visual?
I only see the option to Export Data and then I am asked where to save the file.
In the Create File step, you should put
Great solution
Really does the job
Just one small query, when creating CSV this way - I get a CSV with some rows in crazy heights (e.g 200px or even more).
How can I define in the flow that all rows must be 15px?
Any ideas 💡with latin characters like 'ñ' 'í' 'ó' 'á', couldn't figure out the BOM characters requiered.
@chanwulee
I come back here after my last reply. Everything works except from one character. One cursed characters "à"
It's so strange because the capital version À works fine
@groyet
all the characters you are listing in your reply works for me.
Any ideas?
That "à" was painful but i solved replacing it manually before creating the file and concat the BOM. In detail my flow had a list rows, parse json, select, create csv table, create file in sharepoint. Here is a screenshot:
The NOTE UTENTE field is the one with "à" special character. So in the Select action i put this expression
decodeUriComponent(
replace(
uriComponent(item()?['crcef_anagrafica_utenti2.crcef_note'],null),'%C3%A0','à')
)
I find the url code of "à" that is "%C3%A0". I convert the field in uri component, I replace C3A0 with à, then I decode the uri component.
After the Create CSV table 2 action there is the Create file in sharepoint action
Where in the file content I put this
concat(uriComponentToString('%EF%BB%BF'),body('Create_CSV_table_2'))
Thanks to all your precious tips!
Wonderful!
Exelente solución, facil y limpia!!!!
Muchas gracias!!!
Perfect solution!
User | Count |
---|---|
88 | |
39 | |
23 | |
20 | |
16 |
User | Count |
---|---|
127 | |
49 | |
46 | |
27 | |
25 |