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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to output "emoji" ...
Power Automate
Unanswered

How to output "emoji" characters in UTF-8 from action "Run PowerShell script"?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello PAD community.

 

I am facing this "mojibake" problem and want to know how can I avoid it.

In sample desktop flow as below, I expect the output message of PowerShell to contain emoji characters, but it returns "??" symbol instead.

 

shindomo_0-1634517747078.png

SET Sushi TO $'''🍣 U+1F363'''
SET Beer TO $'''🍺 U+1F37A'''
SET HeavyMultiplicationX TO $'''✖ U+2716'''
Display.ShowMessage Message: $'''Food: %Sushi%
%HeavyMultiplicationX%
Drink: %Beer%''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed
System.RunPowershellScript Script: $'''$food = \"%Sushi%\"
$drink = \"%Beer%\"
$multi = \"%HeavyMultiplicationX%\"
$dinner = \"I would like to have $food $multi $drink.\"
Write-Output $dinner''' ScriptOutput=> PowershellOutput ScriptError=> ScriptError

shindomo_1-1634517817795.png

 

Output text from PowerShell script contains "??" symbol instead of actual "emoji".

I would like to have ?? U+1F363 ? U+2716 ?? U+1F37A.

 

shindomo_2-1634516485464.png

 

Is this an expected behavior, or known issue? Are there any workaround to avoid this garbled text?

 

Thanks in advance.

I have the same question (0)
  • Highboy Profile Picture
    1,185 Super User 2024 Season 1 on at

    Emojis in powershell is not straight forward, and you will never get the emoji icons in the powershell output, as it's text only.
    If you would like to read about emojis in powershell, you can go to this link

    Just a question, why would you use powershell in you script?
     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @Highboy 

     

    Thanks for your response.

     

    My original goal was to have a Base64 encoded string to be decoded using a PowerShell script.

    The Emojis are contained in a user-created file, and I need to restore the file to its exact original state (binary match required).

     

    Since PAD itself does not provide any action to encode / decode Base64, we have to use an external script written in PowerShell / Python / JavaScript / VBScript.

     

    Since Emojis are just UTF-8 characters, they should be able to be displayed via the standard output of the console if handled properly.

     

    When I experimented, I noticed that the results were different depending on the terminal software used, even if it was the same version of PowerShell.

     

    [Windows PowerShell v5.1]

     

    shindomo_1-1635198935067.png

    INPUT: Mojibake

    OUTPUT: 4 bytes chars are mojibake, but can display 3 bytes char properly.

     

    [Windows Terminal + Windows PowerShell v5.1]

     

    shindomo_2-1635198985769.png

    INPUT: Mojibake

    OUTPUT: Can display both 4 bytes chars and 3 bytes char. Looks fine.

     

    [Windows Terminal + PowerShell v7.1.5]

     

    shindomo_3-1635199020677.png

    INPUT: Perfect

    OUTPUT: Perfect

     

    [PowerShell code]

    $food = "🍣 U+1F363"
    $drink = "🍺 U+1F37A"
    $multi = "✖ U+2716"
    $dinner = "I would like to have $food $multi $drink."
    Write-Output $dinner

     

    As a workaround for the time being, I have confirmed that no garbled characters are generated in the output string by using VBScript to process Base64 decoding, but I would like to know how I can get the same result in PowerShell.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard