web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : 7H1AVgS/jR6lOpB41JL/Xi
Power Automate - Using Flows
Suggested answer

"Get file content" changes the file encoding. How to fix?

Like (3) ShareShare
ReportReport
Posted on 18 Sep 2021 00:03:07 by Microsoft Employee

"Get file content" and "Get file content with path" actions (SharePoint based) became to change the encoding of the file. It wasn't like this 2 weeks ago. Looks like a bug to me.
Original file: 

iroprish_0-1631923305503.png

Flow: 

iroprish_1-1631923349248.png

Result:

iroprish_2-1631923380421.png


 😞

  • Suggested answer
    MA-11041301-0 Profile Picture
    2 on 23 May 2025 at 17:01:40
    "Get file content" changes the file encoding. How to fix?
     With the help of  5 on 06 Mar 2025 at 21:58:28
    Create a Compose with this Input:
    concat(uriComponentToString('%EF%BB%Bf'),setProperty(outputs('Get_file_content')?['body'], '$content-type''application/octet-stream;charset=Windows-1251'))
     
    Or just be sure to use utf-8 encoding!
    • Convert the CSV to UTF-8 before processing:

      1. Open the file in Excel  Save As → Choose CSV UTF-8 (Comma delimited) (*.csv).

      2. Re-upload the file to SharePoint/OneDrive and retry the flow.

  • CU06031955-0 Profile Picture
    5 on 06 Mar 2025 at 19:58:28
    "Get file content" changes the file encoding. How to fix?
    I just ran into this problem but it was similar to something I solved before.

    The expression that seems to fix this is:
     
    binary(setProperty(body('Get_file_content_using_path'), '$content-type', 'octet/stream;charset=windows-1252'))

    I don't really understand why "charset=windows-1252" works but "charset=utf-8" does not. but this expression solved it for me.
  • Linn9000 Profile Picture
    4 on 13 Nov 2023 at 14:05:02
    Re: "Get file content" changes the file encoding. How to fix?

    I had the same issue in a somewhat different case (copying a CSV file from SFTP to Sharepoint).  CSV file wasn't the same after copying.

     

    To fix the CSV issues, i set "Infer Content Type" to "No".  After this, my CSV encoding stayed the same

    Linn9000_0-1699884153345.png

     

     

  • rommelrueco Profile Picture
    2 on 18 Oct 2023 at 02:29:10
    Re: "Get file content" changes the file encoding. How to fix?

    You have to update the value of the File Content field in the "Upload File" task.

    From: File Content

    To: concat(uriComponentToString('%EF%BB%BF'),body('Get_file_content'))

     

     

    Note: 

    • You can type the updated value by clicking the "Expression" tab.
    • You can get the value of body('Get_file_content') by clicking the "Dynamic Content" tab and selecting the "File Content"
      rommelrueco_0-1697595818390.png

     

    Explanation:

    .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.

     

    Let me know if this works. It is working fine using the "Create File" task. I haven't tested using the "Upload File" task.

    Rommel Rueco

  • murbanik Profile Picture
    2 on 11 Jan 2023 at 13:56:07
    Re: "Get file content" changes the file encoding. How to fix?

    Anyone?

  • Community Power Platform Member Profile Picture
    on 30 Nov 2022 at 13:03:16
    Re: "Get file content" changes the file encoding. How to fix?

    It doesn't solve the problema in an automated way. I have a flow that read a csv file generated by a system, I cannot manually fix  the file every time.

     

    Is there another way to fix this?

  • Seabass Profile Picture
    4 on 07 Apr 2022 at 13:32:39
    Re: "Get file content" changes the file encoding. How to fix?

    Same issue here!

  • ingmar Profile Picture
    2 on 11 Jan 2022 at 16:26:13
    Re: "Get file content" changes the file encoding. How to fix?

    I'm having the same issue when getting .txt files from an FTP and save it to Sharepoint
    the file on the FTP is encoded UTF-8 BOM when Power Automate get's the file content it shows the file content Binary

    so now characters like é or ü or ï are now �

  • v-bofeng-msft Profile Picture
    on 20 Sep 2021 at 07:55:19
    Re: "Get file content" changes the file encoding. How to fix?

    Hi @iroprish :

    This Post may be similar to the situation you encountered, you may need to Use UTF-8 mode to re-import the file:

    1. Open Microsoft Excel
    2. Click on the Data menu bar option.

    vbofengmsft_0-1632124419326.png

     

    3. Select the file

    vbofengmsft_1-1632124419168.png

     

    vbofengmsft_2-1632124419163.png

     

    4.Choose UTF-8 Mode

    vbofengmsft_3-1632124419156.png

     

    The Result:

    vbofengmsft_4-1632124419347.png

    I think these links will help you a lot:

    Create a .csv file that uses UTF-8 character encoding 
    How to import a .csv file that uses UTF-8 character encoding 

    If you want this problem to be completely resolved, I suggest you consider posting your needs in this forum:

    https://powerusers.microsoft.com/t5/Power-Automate-Ideas/idb-p/MPAIdeas 

    Best Regards,

    Bof

  • iroprish Profile Picture
    Microsoft Employee on 18 Sep 2021 at 00:06:34
    Re: "Get file content" changes the file encoding. How to fix?

    I tried to use .xlsx output type instead of .csv. Also didn't work.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Featured topics

Restore a deleted flow
Loading complete