1

Can I output unicode, like the classic deskflip (╯°□°)╯︵ ┻━┻ to the console?

Do I have to set this 'mode' in the cli when i run the script, or could I do some magic in the script itself so the consumers of my script don't need to remember to do anything funky in the CLI?

this is my screenshot ....

enter image description here

Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
  • 4
    Possible duplicate of [Printing Unicode Characters to Powershell Prompt](http://stackoverflow.com/q/5796339/1630171). – Ansgar Wiechers Dec 08 '14 at 01:22
  • It's strange... everything else I've read indicates that Powershell is basically a .Net language and uses UTF-16, which should have no problem with this. But try to make it work, even when I specifically create a UTF-16 .ps1 file with the correct characters, and it's not so simple. – Joel Coehoorn Dec 08 '14 at 01:25

1 Answers1

3

This is a limitation of the console rather than a limitation of Powershell. If you use a different Powershell host (e.g. the Powershell ISE) then the output will appear as you expect:

PS C:\> write-host "(╯°□°)╯︵ ┻━┻"
(╯°□°)╯︵ ┻━┻

If you try that in the console window you actually get the same characters output (as you can tell if you copy/paste into something that will display them).

Duncan
  • 92,073
  • 11
  • 122
  • 156