Power Automate remove BOM from UTF-8 text file

I have created a cloud flow having a „For a selected item“ trigger on a SharePoint list. As a calling parameter a csv file could be uploaded.

When the csv file for example is edited with Excel and not saved as MSDOS csv file, we get the UTF-8 BOM descriptor at the beginning. Using this in a Compose action:

base64ToString(triggerBody()?['file']?['contentBytes'])

results in (only visible in „Show raw outputs“:

To remove this BOM called three characters you can use:

replace(base64ToString(triggerBody()?['file']?['contentBytes']),uriComponentToString('%EF%BB%BF'),'')

The result:

I found this solution here:

https://powerusers.microsoft.com/t5/Building-Flows/Create-a-csv-file-that-uses-UTF-8-character-encoding/m-p/1311587/highlight/true#M148980