Wednesday, November 3, 2021

Create CSV files with BOM marker in Logic App


In Logic App, we can use "Create CSV Table" action to create a CSV file, but by default, it will not contain BOM marker which will not be able to display special characters (for example Chinese).




For the CSV format, if we want to display non-ASCII characters, we need to put the BOM marker at the beginning of the text content to let the application be able to handle those characters.

Reference: Byte order mark - Wikipedia



As per the document, the only thing we need to do is to append BOM marker at the beginning of our CSV content.

The UTF-8 code for the BOM is 0xEFBBBF, but we cannot use this code in Logic App directly.

So the resolution is to use a tool to convert the code into the exact character.


Although there's nothing displayed in the output textbox, but the character has been decoded and it is a invisible character.

Then we can use Ctrl+A and Ctrl+C to copy and paste it into Logic App.


In the code view, we can see this character is displayed as a special character.



After run the Logic App, the Chinese characters can be shown properly.





Posted at